On Wed, 2012-11-14 at 08:34 +0800, Xie ChanglongX wrote: > Hi Malcolm, > > FYI, there are new smatch warnings show up in > > tree: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-next > head: 1f168dbdf731dea301a297e2409adc4a54ed6612 > commit: 848ce5112e7fcb38aaafff28253314da330b681e [456/499] staging: vt6656: iwctl_giwaplist/device_ioctl : use off stack buffers. >From 3d37e54034217a561f6f66e74af6a75e4320fb61 Mon Sep 17 00:00:00 2001 From: Malcolm Priestley <tvboxspy@xxxxxxxxx> Date: Wed, 14 Nov 2012 19:19:59 +0000 Subject: [PATCH] vt6656: staging: iwctl_giwaplist() warn: possible memory leak of 'qual' Signed-off-by: Malcolm Priestley <tvboxspy@xxxxxxxxx> --- drivers/staging/vt6656/iwctl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/iwctl.c b/drivers/staging/vt6656/iwctl.c index a914d20..08557fa 100644 --- a/drivers/staging/vt6656/iwctl.c +++ b/drivers/staging/vt6656/iwctl.c @@ -655,9 +655,13 @@ int iwctl_giwaplist(struct net_device *dev, struct iw_request_info *info, return -EINVAL; sock = kzalloc(sizeof(struct sockaddr) * IW_MAX_AP, GFP_KERNEL); + if (sock == NULL) + return -ENOMEM; qual = kzalloc(sizeof(struct iw_quality) * IW_MAX_AP, GFP_KERNEL); - if (sock == NULL || qual == NULL) + if (qual == NULL) { + kfree(sock); return -ENOMEM; + } for (ii = 0, jj = 0; ii < MAX_BSS_NUM; ii++) { if (!pBSS[ii].bActive) -- 1.7.10.4 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel