Skip to content

Commit

Permalink
staging: vt6656: iwctl_giwaplist() re warn: possible memory leak of '…
Browse files Browse the repository at this point in the history
…qual'

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Malcolm Priestley authored and Greg Kroah-Hartman committed Nov 15, 2012
1 parent 4087641 commit 2a38e6f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/staging/vt6656/iwctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2a38e6f

Please sign in to comment.