mac80211: don't attempt to rename ERR_PTR() debugfs dirs

We need to dereference the directory to get its parent to
be able to rename it, so it's clearly not safe to try to
do this with ERR_PTR() pointers. Skip in this case.

It seems that this is most likely what was causing the
report by syzbot, but I'm not entirely sure as it didn't
come with a reproducer this time.

Cc: [email protected]
Reported-by: [email protected]
Signed-off-by: Johannes Berg <[email protected]>
This commit is contained in:
Johannes Berg committed 2019-04-23 13:47:05 +02:00
1 parent 8772eed9a9
commit 5178791474
1 file changed
+1 -1
+1 -1
View File
@@ -841,7 +841,7 @@ void ieee80211_debugfs_rename_netdev(struct ieee80211_sub_if_data *sdata)
dir = sdata->vif.debugfs_dir;
if (!dir)
if (IS_ERR_OR_NULL(dir))
return;
sprintf(buf, "netdev:%s", sdata->name);