Search Linux Wireless

[bug report] mt76: usb: fix possible memory leak in mt76u_buf_free

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux