mt76: usb: fix warning in mt76u_buf_free
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
[email protected]
maintainerPATCH 1/1 mt76: usb: fix warning in mt76u_buf_free
From: Lorenzo Bianconi <[email protected]>
Fix following static checker warning in mt76u_buf_free:
drivers/net/wireless/mediatek/mt76/usb.c:372 mt76u_buf_free()
warn: address of 'urb->sg[i]' is non-NULL
There is no need to check sg page pointer since urb->num_sgs has been already validated in mt76u_fill_rx_sg
--- drivers/net/wireless/mediatek/mt76/usb.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/net/wireless/mediatek/mt76/usb.c +2 -7
@@ -364,16 +364,11 @@ mt76u_buf_alloc(struct mt76_dev *dev, struct mt76u_buf *buf)void mt76u_buf_free (struct mt76u_buf *buf) {struct urb *urb = buf->urb; -struct scatterlist *sg;int i; -for (i =0 ; i < urb->num_sgs; i++) { - sg = &urb->sg[i]; -if (!sg) -continue ; +for (i =0 ; i < urb->num_sgs; i++) +skb_free_frag (sg_virt (&urb->sg[i])); -skb_free_frag (sg_virt (sg)); - }if (buf->buf)skb_free_frag (buf->buf);
Signature · 1 line
2.20.1
Quoted 11 lines · [email protected] writes:
From: Lorenzo Bianconi <[email protected]>
Fix following static checker warning in
mt76u_buf_free:
drivers/net/wireless/mediatek/mt76/usb.c:372mt76u_buf_free()
warn: address of 'urb->sg[i]' is non-NULLThere is no need to check sg page pointer since
urb->num_sgshas been already validated inmt76u_fill_rx_sgFixes cb83585e1121 ("mt76: usb: fix possible memory leak in mt76u_buf_free")Signed-off-by Lorenzo Bianconi <[email protected]>
The merge window is really close, should I take this directly to wireless-drivers-next?
BTW, Lorenzo please add your name to SMTP From line to make threading cleaner:
From: [email protected]
Signature · 1 line
Kalle Valo
Lorenzo Bianconi
maintainerQuoted 8 lines
Quoted 6 lines · [email protected] writes:
From: Lorenzo Bianconi <[email protected]>
Fix following static checker warning in
mt76u_buf_free:
drivers/net/wireless/mediatek/mt76/usb.c:372mt76u_buf_free()
warn: address of 'urb->sg[i]' is non-NULL
Quoted 8 lines
Quoted 5 lines
There is no need to check sg page pointer since
urb->num_sgshas been already validated inmt76u_fill_rx_sgFixes cb83585e1121 ("mt76: usb: fix possible memory leak in mt76u_buf_free")Signed-off-by Lorenzo Bianconi <[email protected]>The merge window is really close, should I take this directly to wireless-drivers-next?
Hi Kalle,
I think this patch can go in Felix's tree for the moment since it just fixes the warning, the intended behaviour is to run skb_free_frag()
Regards,
Lorenzo
Quoted 8 lines
BTW, Lorenzo please add your name to SMTP From line to make threading cleaner:
From: [email protected]
Signature · 1 line
Kalle Valo
Quoted 11 lines · On 2019-02-21 00:57, [email protected] wrote:
From: Lorenzo Bianconi <[email protected]>
Fix following static checker warning in
mt76u_buf_free:
drivers/net/wireless/mediatek/mt76/usb.c:372mt76u_buf_free()
warn: address of 'urb->sg[i]' is non-NULLThere is no need to check sg page pointer since
urb->num_sgshas been already validated inmt76u_fill_rx_sgFixes cb83585e1121 ("mt76: usb: fix possible memory leak in mt76u_buf_free")Signed-off-by Lorenzo Bianconi <[email protected]>
Applied, thanks.
- Felix