* [bug report] mt76: usb: fix possible memory leak in mt76u_buf_free
@ 2019-02-20 20:57 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2019-02-20 20:57 UTC (permalink / raw)
To: lorenzo.bianconi; +Cc: linux-wireless, linux-mediatek
Hello Lorenzo Bianconi,
The patch cb83585e1121: "mt76: usb: fix possible memory leak in
mt76u_buf_free" from Feb 10, 2019, leads to the following static
checker warning:
drivers/net/wireless/mediatek/mt76/usb.c:372 mt76u_buf_free()
warn: address of 'urb->sg[i]' is non-NULL
drivers/net/wireless/mediatek/mt76/usb.c
362 }
363
364 void mt76u_buf_free(struct mt76u_buf *buf)
365 {
366 struct urb *urb = buf->urb;
367 struct scatterlist *sg;
368 int i;
369
370 for (i = 0; i < urb->num_sgs; i++) {
371 sg = &urb->sg[i];
--> 372 if (!sg)
^^^
This address isn't NULL. Was something else intended?
373 continue;
374
375 skb_free_frag(sg_virt(sg));
376 }
377 if (buf->buf)
378 skb_free_frag(buf->buf);
379
380 usb_free_urb(buf->urb);
381 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-02-20 20:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-20 20:57 [bug report] mt76: usb: fix possible memory leak in mt76u_buf_free Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).