]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: qca8k: fix NULL pointer dereference for of_device_get_match_data
authorChristian Marangi <ansuelsmth@gmail.com>
Sun, 4 Sep 2022 21:53:19 +0000 (23:53 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 6 Sep 2022 09:18:15 +0000 (11:18 +0200)
commitfd6e81e8199421bbfceae391f1d028cbae48864e
tree6a932db3753eabeb760776f701f48c0772f6d5e3
parentda3f26c21703c5cd84a59d36953d4433b7b60015
net: dsa: qca8k: fix NULL pointer dereference for of_device_get_match_data

of_device_get_match_data is called on priv->dev before priv->dev is
actually set. Move of_device_get_match_data after priv->dev is correctly
set to fix this kernel panic.

Fixes: 389003b77083 ("net: dsa: qca8k: cache match data to speed up access")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20220904215319.13070-1-ansuelsmth@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/dsa/qca/qca8k-8xxx.c