Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53216d6a authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by John W. Linville
Browse files

rt2800: do not crash if spec->channels is NULL



In case the spec->channels was not specified, print warning instead
of hard crash the kernel.

Signed-off-by: default avatarStanislaw Gruszka <stf_xl@wp.pl>
Tested-by: default avatarWanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 8857d6dc
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -5213,6 +5213,9 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
		spec->channels = rf_vals_3x;
	}

	if (WARN_ON_ONCE(!spec->channels))
		return -ENODEV;

	/*
	 * Initialize HT information.
	 */