Thread (4 messages) 4 messages, 2 authors, 2017-08-21

Re: [PATCH] mt7601u: check memory allocation failure

From: Christophe JAILLET <hidden>
Date: 2017-08-21 22:09:00
Also in: kernel-janitors, linux-arm-kernel, linux-mediatek, lkml, netdev

Le 21/08/2017 à 23:41, Jakub Kicinski a écrit :
On Mon, 21 Aug 2017 14:34:30 -0700, Jakub Kicinski wrote:
quoted
On Mon, 21 Aug 2017 22:59:56 +0200, Christophe JAILLET wrote:
quoted
Check memory allocation failure and return -ENOMEM in such a case, as
already done a few lines below

Signed-off-by: Christophe JAILLET <redacted>
Acked-by: Jakub Kicinski <redacted>
Wait, I take that back.  This code is a bit weird.  We would return an
error, then mt7601u_dma_init() will call mt7601u_free_tx_queue() which
doesn't check for tx_q == NULL condition.

Looks like mt7601u_free_tx() has to check for dev->tx_q == NULL and
return early if that's the case.  Or mt7601u_alloc_tx() should really
clean things up on it's own on failure.  Ugh.
You are right. Thanks for the review.

I've sent a v2 which updates 'mt7601u_free_tx()'.
Doing so sounds more in line with the spirit of this code.

CJ
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help