Bug 188671 - Function orinoco_ioctl_commit() returns an improper error code when the call to orinoco_lock() fails
Summary: Function orinoco_ioctl_commit() returns an improper error code when the call ...
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: network-wireless (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_network-wireless@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-25 10:47 UTC by bianpan
Modified: 2016-11-25 10:47 UTC (History)
0 users

See Also:
Kernel Version: linux-4.9-rc6
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description bianpan 2016-11-25 10:47:16 UTC
In the function orinoco_ioctl_commit() defined in file drivers/net/wireless/intersil/orinoco/wext.c, variable err takes the error code. However, the value of variable err keeps 0 (indicates success) even when the call to orinoco_lock() (at line 1316) fails. Maybe it is better to assign "-EBUSY" to err when the call to orinoco_lock() fails. Codes related to this bug are shown as follows.

orinoco_ioctl_commit @@ drivers/net/wireless/intersil/orinoco/wext.c
1303 /* Commit handler, called after set operations */
1304 static int orinoco_ioctl_commit(struct net_device *dev,
1305                 struct iw_request_info *info,
1306                 void *wrqu,
1307                 char *extra)
1308 {
1309     struct orinoco_private *priv = ndev_priv(dev);
1310     unsigned long flags;
1311     int err = 0;
1312 
1313     if (!priv->open)
1314         return 0;
1315 
1316     if (orinoco_lock(priv, &flags) != 0)
1317         return err;    // insert "err = -EBUSY;" before this return statement?
1318 
1319     err = orinoco_commit(priv);
1320 
1321     orinoco_unlock(priv, &flags);
1322     return err;
1323 }

Thanks very much!

Note You need to log in before you can comment on or make changes to this bug.