Skip to content

Commit 923eaf3

Browse files
ariknemjmberg-intel
authored andcommitted
mac80211: don't check netdev state for debugfs read/write
Doing so will lead to an oops for a p2p-dev interface, since it has no netdev. Cc: stable@vger.kernel.org Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 494b659 commit 923eaf3

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎net/mac80211/debugfs_netdev.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ static ssize_t ieee80211_if_read(
3434
ssize_t ret = -EINVAL;
3535

3636
read_lock(&dev_base_lock);
37-
if (sdata->dev->reg_state == NETREG_REGISTERED)
38-
ret = (*format)(sdata, buf, sizeof(buf));
37+
ret = (*format)(sdata, buf, sizeof(buf));
3938
read_unlock(&dev_base_lock);
4039

4140
if (ret >= 0)
@@ -62,8 +61,7 @@ static ssize_t ieee80211_if_write(
6261

6362
ret = -ENODEV;
6463
rtnl_lock();
65-
if (sdata->dev->reg_state == NETREG_REGISTERED)
66-
ret = (*write)(sdata, buf, count);
64+
ret = (*write)(sdata, buf, count);
6765
rtnl_unlock();
6866

6967
return ret;

0 commit comments

Comments
 (0)