[PATCH] staging: rtl8712: return error directly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@xxxxxxxxxxx>

return error directly to avoid unwanted branching where no cleanup
is done.Also removes the ret variable.
---
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index 663f5bd..f563b2d 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -2054,21 +2054,15 @@ static int r871x_set_chplan(struct net_device *dev,
 				struct iw_request_info *info,
 				union iwreq_data *wrqu, char *extra)
 {
-	int ret = 0;
 	struct _adapter *padapter = netdev_priv(dev);
 	struct iw_point *pdata = &wrqu->data;
 	int ch_plan = -1;
 
-	if ((padapter->bDriverStopped) || (pdata == NULL)) {
-		ret = -EINVAL;
-		goto exit;
-	}
+	if ((padapter->bDriverStopped) || (pdata == NULL))
+		return -EINVAL;
 	ch_plan = (int)*extra;
 	r8712_set_chplan_cmd(padapter, ch_plan);
-
-exit:
-
-	return ret;
+	return 0;
 }
 
 static int r871x_wps_start(struct net_device *dev,
-- 
1.9.1
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux