Constant is used to allocate memory for a buffer, then buffer is filled upto 'size' which is passed as a parameter. If 'size' is bigger than the constant then the buffer will overflow. We could check the 'size' parameter and fail but better not to fail. Use 'size' as the parameter to kmalloc() instead of a constant. Signed-off-by: Tobin C. Harding <me@xxxxxxxx> --- drivers/staging/ks7010/ks7010_sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index 3403edd..341bce4 100644 --- a/drivers/staging/ks7010/ks7010_sdio.c +++ b/drivers/staging/ks7010/ks7010_sdio.c @@ -683,7 +683,7 @@ static int ks7010_sdio_data_compare(struct ks_wlan_private *priv, u32 address, int ret; unsigned char *read_buf; - read_buf = kmalloc(ROM_BUFF_SIZE, GFP_KERNEL); + read_buf = kmalloc(size, GFP_KERNEL); if (!read_buf) return -ENOMEM; -- 2.7.4 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel