diff options
author | Malcolm Priestley <tvboxspy@gmail.com> | 2012-11-15 16:57:29 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-15 15:26:14 -0800 |
commit | 2a38e6fcf9173ffa8acf827c0b5d69863e012434 (patch) | |
tree | c95ff5403bc267db5694c848aa453b7076d2d33b /drivers/staging/vt6656 | |
parent | 4087641b255cb003ce653aac79e3445fcb864552 (diff) | |
download | op-kernel-dev-2a38e6fcf9173ffa8acf827c0b5d69863e012434.zip op-kernel-dev-2a38e6fcf9173ffa8acf827c0b5d69863e012434.tar.gz |
staging: vt6656: iwctl_giwaplist() re warn: possible memory leak of 'qual'
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6656')
-rw-r--r-- | drivers/staging/vt6656/iwctl.c | 6 |
1 files changed, 5 insertions, 1 deletions
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) |