fpga: zynqmp-fpga: Correctly handle error pointer

Fixes the following static checker errors:

drivers/fpga/zynqmp-fpga.c:50 zynqmp_fpga_ops_write()
error: 'eemi_ops' dereferencing possible ERR_PTR()

drivers/fpga/zynqmp-fpga.c:84 zynqmp_fpga_ops_state()
error: 'eemi_ops' dereferencing possible ERR_PTR()

Note: This does not handle the EPROBE_DEFER value in a
special manner.

Fixes commit c09f7471127e ("fpga manager: Adding FPGA Manager support for
Xilinx zynqmp")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Moritz Fischer <mdf@kernel.org>
Acked-by: Alan Tull <atull@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Moritz Fischer and committed by
Greg Kroah-Hartman
498ddaa3 bd17cc5a

+2 -2
+2 -2
drivers/fpga/zynqmp-fpga.c
··· 47 47 char *kbuf; 48 48 int ret; 49 49 50 - if (!eemi_ops || !eemi_ops->fpga_load) 50 + if (IS_ERR_OR_NULL(eemi_ops) || !eemi_ops->fpga_load) 51 51 return -ENXIO; 52 52 53 53 priv = mgr->priv; ··· 81 81 const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); 82 82 u32 status; 83 83 84 - if (!eemi_ops || !eemi_ops->fpga_get_status) 84 + if (IS_ERR_OR_NULL(eemi_ops) || !eemi_ops->fpga_get_status) 85 85 return FPGA_MGR_STATE_UNKNOWN; 86 86 87 87 eemi_ops->fpga_get_status(&status);