summaryrefslogtreecommitdiff
path: root/drivers/net/wan
diff options
context:
space:
mode:
authorPeng Li <lipeng321@huawei.com>2021-06-17 22:03:17 +0800
committerDavid S. Miller <davem@davemloft.net>2021-06-17 12:08:46 -0700
commit4ec479527b9a637d4115d428f0b59d28f0760723 (patch)
tree4df7777338d737f63637ac0bb4c4786e0e226505 /drivers/net/wan
parentcb36c4112c528ffa6b2005bb083559c54d66810e (diff)
net: hdlc_ppp: move out assignment in if condition
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>
Diffstat (limited to 'drivers/net/wan')
-rw-r--r--drivers/net/wan/hdlc_ppp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wan/hdlc_ppp.c b/drivers/net/wan/hdlc_ppp.c
index 861491206f12..fb5102c1afc6 100644
--- 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 */
}