Commit 253804a2 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

staging: ath6kl: cleanup in SEND_FRAME ioctl

The original code was written in a funny way where every statement was
part of else if blocks.  I broke them up into separate statements by
adding breaks on failure conditions.
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Acked-by: default avatarVipin Mehta <vipin.mehta@atheros.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 108160db
...@@ -3162,29 +3162,31 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -3162,29 +3162,31 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
case AR6000_XIOCTL_OPT_SEND_FRAME: case AR6000_XIOCTL_OPT_SEND_FRAME:
{ {
WMI_OPT_TX_FRAME_CMD optTxFrmCmd; WMI_OPT_TX_FRAME_CMD optTxFrmCmd;
u8 data[MAX_OPT_DATA_LEN]; u8 data[MAX_OPT_DATA_LEN];
if (ar->arWmiReady == false) { if (ar->arWmiReady == false) {
ret = -EIO; ret = -EIO;
} else if (copy_from_user(&optTxFrmCmd, userdata, break;
sizeof(optTxFrmCmd))) }
{
if (copy_from_user(&optTxFrmCmd, userdata, sizeof(optTxFrmCmd))) {
ret = -EFAULT; ret = -EFAULT;
} else if (copy_from_user(data, break;
userdata+sizeof(WMI_OPT_TX_FRAME_CMD)-1, }
optTxFrmCmd.optIEDataLen))
{ if (copy_from_user(data, userdata+sizeof(WMI_OPT_TX_FRAME_CMD) - 1,
optTxFrmCmd.optIEDataLen)) {
ret = -EFAULT; ret = -EFAULT;
} else { break;
ret = wmi_opt_tx_frame_cmd(ar->arWmi, }
ret = wmi_opt_tx_frame_cmd(ar->arWmi,
optTxFrmCmd.frmType, optTxFrmCmd.frmType,
optTxFrmCmd.dstAddr, optTxFrmCmd.dstAddr,
optTxFrmCmd.bssid, optTxFrmCmd.bssid,
optTxFrmCmd.optIEDataLen, optTxFrmCmd.optIEDataLen,
data); data);
}
break; break;
} }
case AR6000_XIOCTL_WMI_SETRETRYLIMITS: case AR6000_XIOCTL_WMI_SETRETRYLIMITS:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment