projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb36c41
)
net: hdlc_ppp: move out assignment in if condition
author
Peng Li
<lipeng321@huawei.com>
Thu, 17 Jun 2021 14:03:17 +0000
(22:03 +0800)
committer
David S. Miller
<davem@davemloft.net>
Thu, 17 Jun 2021 19:08:46 +0000
(12:08 -0700)
Should not use assignment in if condition.
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wan/hdlc_ppp.c
patch
|
blob
|
history
diff --git
a/drivers/net/wan/hdlc_ppp.c
b/drivers/net/wan/hdlc_ppp.c
index 861491206f126dc1331cd557ac71b39babfe219e..fb5102c1afc6d74bb9c9fa2f204d0666f5b0d4dd 100644
(file)
--- a/
drivers/net/wan/hdlc_ppp.c
+++ b/
drivers/net/wan/hdlc_ppp.c
@@
-375,7
+375,8
@@
static void ppp_cp_parse_cr(struct net_device *dev, u16 pid, u8 id,
u8 *out;
unsigned int len = req_len, nak_len = 0, rej_len = 0;
- if (!(out = kmalloc(len, GFP_ATOMIC))) {
+ out = kmalloc(len, GFP_ATOMIC);
+ if (!out) {
dev->stats.rx_dropped++;
return; /* out of memory, ignore CR packet */
}