projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e3e37e7
)
net: ethernet: ti: davinci_cpdma: correct check on NULL in set rate
author
Ivan Khoronzhuk
<
[email protected]
>
Wed, 18 Jan 2017 00:28:06 +0000
(
02:28
+0200)
committer
David S. Miller
<
[email protected]
>
Wed, 18 Jan 2017 21:46:01 +0000
(16:46 -0500)
Check "ch" on NULL first, then get ctlr.
Signed-off-by: Ivan Khoronzhuk <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/ethernet/ti/davinci_cpdma.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/ti/davinci_cpdma.c
b/drivers/net/ethernet/ti/davinci_cpdma.c
index d80bff19d4ec5c6f8586cca8ade8f2f4adb0edcf..7ecc6b70e7e898a5b0bd052cf60423d942905131 100644
(file)
--- a/
drivers/net/ethernet/ti/davinci_cpdma.c
+++ b/
drivers/net/ethernet/ti/davinci_cpdma.c
@@
-835,8
+835,8
@@
EXPORT_SYMBOL_GPL(cpdma_chan_get_min_rate);
*/
int cpdma_chan_set_rate(struct cpdma_chan *ch, u32 rate)
{
- struct cpdma_ctlr *ctlr = ch->ctlr;
unsigned long flags, ch_flags;
+ struct cpdma_ctlr *ctlr;
int ret, prio_mode;
u32 rmask;
@@
-846,6
+846,7
@@
int cpdma_chan_set_rate(struct cpdma_chan *ch, u32 rate)
if (ch->rate == rate)
return rate;
+ ctlr = ch->ctlr;
spin_lock_irqsave(&ctlr->lock, flags);
spin_lock_irqsave(&ch->lock, ch_flags);