net: phy: micrel: Fix warn: passing zero to PTR_ERR
authorDivya Koppera <Divya.Koppera@microchip.com>
Fri, 6 Jan 2023 08:29:05 +0000 (13:59 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 Jan 2023 07:21:42 +0000 (07:21 +0000)
commit3f88d7d1be42a84a4ae292f085c3886597a04137
treede8bd811cb6b761fdd9d9164ec503de6b2b9d470
parentd50ede4f53e19b63f785768ce62f9a5019c3a021
net: phy: micrel: Fix warn: passing zero to PTR_ERR

Handle the NULL pointer case

Fixes New smatch warnings:
drivers/net/phy/micrel.c:2613 lan8814_ptp_probe_once() warn: passing zero to 'PTR_ERR'

vim +/PTR_ERR +2613 drivers/net/phy/micrel.c
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Signed-off-by: Divya Koppera <Divya.Koppera@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/micrel.c