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
......@@ -3167,24 +3167,26 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
if (ar->arWmiReady == false) {
ret = -EIO;
} else if (copy_from_user(&optTxFrmCmd, userdata,
sizeof(optTxFrmCmd)))
{
break;
}
if (copy_from_user(&optTxFrmCmd, userdata, sizeof(optTxFrmCmd))) {
ret = -EFAULT;
} else if (copy_from_user(data,
userdata+sizeof(WMI_OPT_TX_FRAME_CMD)-1,
optTxFrmCmd.optIEDataLen))
{
break;
}
if (copy_from_user(data, userdata+sizeof(WMI_OPT_TX_FRAME_CMD) - 1,
optTxFrmCmd.optIEDataLen)) {
ret = -EFAULT;
} else {
break;
}
ret = wmi_opt_tx_frame_cmd(ar->arWmi,
optTxFrmCmd.frmType,
optTxFrmCmd.dstAddr,
optTxFrmCmd.bssid,
optTxFrmCmd.optIEDataLen,
data);
}
break;
}
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