[PATCH] staging/wilc1000: fixes kzalloc call

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

 



The wl pointer was initialized as a pointer to a struct wilc and
assigned to a piece of memory the size of the pointer. It should be the
size of struct wilc.

Signed-off-by: Lidza Louina <lidza.louina@xxxxxxxxxx>
---
 drivers/staging/wilc1000/linux_wlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 4f93c11..d1853f6 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1260,7 +1260,7 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type,
 
 	sema_init(&close_exit_sync, 0);
 
-	wl = kzalloc(sizeof(*wl), GFP_KERNEL);
+	wl = kzalloc(sizeof(struct wilc), GFP_KERNEL);
 	if (!wl)
 		return -ENOMEM;
 
-- 
1.9.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux