summaryrefslogtreecommitdiffstats
path: root/net/ethtool
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-01-08 08:42:36 +0300
committerDavid S. Miller <davem@davemloft.net>2020-01-08 16:03:35 -0800
commitac9c41d5a053e71777e8c2191681358499eff04b (patch)
tree05e2c24f5a75c762001bd2efab7fb964fe390dc5 /net/ethtool
parentd97772dbd7727655aa894f1610e983e73678212e (diff)
downloadlinux-ac9c41d5a053e71777e8c2191681358499eff04b.tar.gz
linux-ac9c41d5a053e71777e8c2191681358499eff04b.tar.bz2
linux-ac9c41d5a053e71777e8c2191681358499eff04b.zip
ethtool: potential NULL dereference in strset_prepare_data()
Smatch complains that the NULL checking isn't done consistently: net/ethtool/strset.c:253 strset_prepare_data() error: we previously assumed 'dev' could be null (see line 233) It looks like there is a missing return on this path. Fixes: 71921690f974 ("ethtool: provide string sets with STRSET_GET request") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Michal Kubecek <mkubecek@suse.cz> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ethtool')
-rw-r--r--net/ethtool/strset.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ethtool/strset.c b/net/ethtool/strset.c
index 9f2243329015..82a059c13c1c 100644
--- a/net/ethtool/strset.c
+++ b/net/ethtool/strset.c
@@ -239,6 +239,7 @@ static int strset_prepare_data(const struct ethnl_req_info *req_base,
return -EINVAL;
}
}
+ return 0;
}
ret = ethnl_ops_begin(dev);