qca-nss-dp: fix oops in nss_dp_probe
authorPetr Štetiar <ynezz@true.cz>
Mon, 29 May 2023 17:27:15 +0000 (19:27 +0200)
committerPetr Štetiar <ynezz@true.cz>
Mon, 5 Jun 2023 06:31:36 +0000 (08:31 +0200)
commit38c7cf0e69aeefdec44d513307732e4daf7d9794
tree2c666ce282da28ffc655bce6d7100de34dcfea04
parentb6e0a24c492537e5bbfa015e2a3638ccc53c164b
qca-nss-dp: fix oops in nss_dp_probe

Currently kernel crashes when of_phy_connect has issues:

 Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000000000000308
 ...
 pc : phy_attached_print+0x28/0x1b0
 lr : phy_attached_info+0x14/0x20
 ...
 Call trace:
  phy_attached_print+0x28/0x1b0
  phy_attached_info+0x14/0x20
  nss_dp_adjust_link+0x544/0x6c4 [qca_nss_dp]

of_phy_connect returns either pointer or NULL, so can't be checked with
IS_ERR macro.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
package/kernel/qca-nss-dp/patches/0013-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch