[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170821205956.20859-1-christophe.jaillet@wanadoo.fr>
Date: Mon, 21 Aug 2017 22:59:56 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: kubakici@...pl, kvalo@...eaurora.org, matthias.bgg@...il.com
Cc: linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: [PATCH] mt7601u: check memory allocation failure
Check memory allocation failure and return -ENOMEM in such a case, as
already done a few lines below
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
drivers/net/wireless/mediatek/mt7601u/dma.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt7601u/dma.c b/drivers/net/wireless/mediatek/mt7601u/dma.c
index 660267b359e4..fa0173579d32 100644
--- a/drivers/net/wireless/mediatek/mt7601u/dma.c
+++ b/drivers/net/wireless/mediatek/mt7601u/dma.c
@@ -484,6 +484,8 @@ static int mt7601u_alloc_tx(struct mt7601u_dev *dev)
dev->tx_q = devm_kcalloc(dev->dev, __MT_EP_OUT_MAX,
sizeof(*dev->tx_q), GFP_KERNEL);
+ if (!dev->tx_q)
+ return -ENOMEM;
for (i = 0; i < __MT_EP_OUT_MAX; i++)
if (mt7601u_alloc_tx_queue(dev, &dev->tx_q[i]))
--
2.11.0
Powered by blists - more mailing lists