Skip to content

Commit

Permalink
staging: vt6656: don't leak 'param' in vt6656_hostap_ioctl() when ret…
Browse files Browse the repository at this point in the history
…urning -EOPNOTSUPP

Don't return -EOPNOTSUPP directly in switch case's since it'll leak
the memory allocated to 'param' when that variable goes out of scope
without having been assigned to anything.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jesper Juhl authored and Greg Kroah-Hartman committed Aug 14, 2012
1 parent b95dd03 commit fb841d6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/staging/vt6656/hostap.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,8 @@ int vt6656_hostap_ioctl(PSDevice pDevice, struct iw_point *p)
break;
case VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR \n");
return -EOPNOTSUPP;
break;
ret = -EOPNOTSUPP;
goto out;
case VIAWGET_HOSTAPD_FLUSH:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_FLUSH \n");
spin_lock_irq(&pDevice->lock);
Expand Down Expand Up @@ -777,13 +777,13 @@ int vt6656_hostap_ioctl(PSDevice pDevice, struct iw_point *p)

case VIAWGET_HOSTAPD_STA_CLEAR_STATS:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_STA_CLEAR_STATS \n");
return -EOPNOTSUPP;

ret = -EOPNOTSUPP;
goto out;
default:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "vt6656_hostap_ioctl: unknown cmd=%d\n",
(int)param->cmd);
return -EOPNOTSUPP;
break;
ret = -EOPNOTSUPP;
goto out;
}


Expand Down

0 comments on commit fb841d6

Please sign in to comment.