mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
ethtool: fix error handling in linkstate_prepare_data()
When getting SQI or maximum SQI value fails in linkstate_prepare_data(), we
must not return without calling ethnl_ops_complete(dev) as that could
result in imbalance between ethtool_ops ->begin() and ->complete() calls.
Fixes: 8066021915
("ethtool: provide UAPI for PHY Signal Quality Index (SQI)")
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
0e00c05fa7
commit
1ae71d997a
@@ -78,19 +78,18 @@ static int linkstate_prepare_data(const struct ethnl_req_info *req_base,
|
|||||||
|
|
||||||
ret = linkstate_get_sqi(dev);
|
ret = linkstate_get_sqi(dev);
|
||||||
if (ret < 0 && ret != -EOPNOTSUPP)
|
if (ret < 0 && ret != -EOPNOTSUPP)
|
||||||
return ret;
|
goto out;
|
||||||
|
|
||||||
data->sqi = ret;
|
data->sqi = ret;
|
||||||
|
|
||||||
ret = linkstate_get_sqi_max(dev);
|
ret = linkstate_get_sqi_max(dev);
|
||||||
if (ret < 0 && ret != -EOPNOTSUPP)
|
if (ret < 0 && ret != -EOPNOTSUPP)
|
||||||
return ret;
|
goto out;
|
||||||
|
|
||||||
data->sqi_max = ret;
|
data->sqi_max = ret;
|
||||||
|
|
||||||
|
ret = 0;
|
||||||
|
out:
|
||||||
ethnl_ops_complete(dev);
|
ethnl_ops_complete(dev);
|
||||||
|
return ret;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int linkstate_reply_size(const struct ethnl_req_info *req_base,
|
static int linkstate_reply_size(const struct ethnl_req_info *req_base,
|
||||||
|
Reference in New Issue
Block a user