Re: [PATCH] virtio_net: memset scatterlist before using

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

 



From: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
Date: Sun, 26 Apr 2009 22:28:08 +0930

> On Sat, 25 Apr 2009 12:07:03 am Alex Williamson wrote:
>> A powerpc gcc-4.4 build generates the following warnings:
>> 
>> drivers/net/virtio_net.c: In function 'virnet_vlan_rx_add_vid':
>> include/linux/scatterlist.h:57: warning: 'sg' is used uninitialized in this function
>> drivers/net/virtio_net.c:746: note: 'sg' was declared here
>> drivers/net/virtio_net.c: In function 'virnet_vlan_rx_kill_vid':
>> include/linux/scatterlist.h:57: warning: 'sg' is used uninitialized in this function
>> drivers/net/virtio_net.c:758: note: 'sg' was declared here
>> 
>> We need to clear the scatterlist before using it.  This sg entry will
>> get copied into another scatterlist before it's used, so memset it
>> rather than using sg_init_table or sg_init_one to avoid a bogus end
>> marker.
> 
> This will break CONFIG_DEBUG_SG=y.
> 
> Why not sg_init_one?  This is what it's for...

Right.

Also, patch not sent to netdev due to a typo, and if it's not
sent to netdev it won't get tracked in patchwork and is therefore
likely to get lost.
--
To unsubscribe from this list: send the line "unsubscribe linux-next" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux