Skip to content

Commit 5178791

Browse files
committed
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]>
1 parent 8772eed commit 5178791

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/mac80211/debugfs_netdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ void ieee80211_debugfs_rename_netdev(struct ieee80211_sub_if_data *sdata)
841841

842842
dir = sdata->vif.debugfs_dir;
843843

844-
if (!dir)
844+
if (IS_ERR_OR_NULL(dir))
845845
return;
846846

847847
sprintf(buf, "netdev:%s", sdata->name);

0 commit comments

Comments
 (0)