[PATCH 1/2] isdn: correctly check failed allocation

From: Insu Yun
Date: Thu Oct 15 2015 - 12:29:24 EST


Since skb_clone can be failed in memory pressure,
return value of skb_clone needs to be checked.

Signed-off-by: Insu Yun <wuninsu@xxxxxxxxx>
---
drivers/isdn/hisax/isdnl2.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/isdn/hisax/isdnl2.c b/drivers/isdn/hisax/isdnl2.c
index 18accb0..e74f847 100644
--- a/drivers/isdn/hisax/isdnl2.c
+++ b/drivers/isdn/hisax/isdnl2.c
@@ -1284,6 +1284,10 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg)
}
l2->windowar[p1] = skb_clone(skb, GFP_ATOMIC);

+ if (!l2->windowar[p1]) {
+ return;
+ }
+
i = sethdraddr(&st->l2, header, CMD);

if (test_bit(FLG_MOD128, &l2->flag)) {
--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/