Johannes Berg 0bbab5f030 cfg80211: fix debugfs rename crash
Removing the "if (IS_ERR(dir)) dir = NULL;" check only works
if we adjust the remaining code to not rely on it being NULL.
Check IS_ERR_OR_NULL() before attempting to dereference it.

I'm not actually entirely sure this fixes the syzbot crash as
the kernel config indicates that they do have DEBUG_FS in the
kernel, but this is what I found when looking there.

Cc: stable@vger.kernel.org
Fixes: d82574a8e5a4 ("cfg80211: no need to check return value of debugfs_create functions")
Reported-by: syzbot+fd5332e429401bf42d18@syzkaller.appspotmail.com
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20200525113816.fc4da3ec3d4b.Ica63a110679819eaa9fb3bc1b7437d96b1fd187d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-05-25 13:12:32 +02:00
..
2020-04-03 13:12:26 -07:00
2020-03-23 21:57:44 -07:00
2020-01-27 11:09:31 +01:00
2019-09-26 08:56:17 +02:00
2019-12-09 10:36:44 -08:00
2020-05-12 18:12:40 -07:00
2019-11-26 14:40:13 -08:00
2020-05-15 14:03:13 -07:00
2020-01-24 13:44:07 +01:00
2020-03-30 12:18:49 -07:00