ice: gnss: fix a NULL vs IS_ERR() check
Subsystems (3)
PATCH 1/1 ice: gnss: fix a NULL vs IS_ERR() check
The tty_alloc_driver() function returns error pointers, it never returns NULL.
Fixes 43113ff73453 ("ice: add TTY for GNSS module for E810T device")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/net/ethernet/intel/ice/ice_gnss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_gnss.c +1 -1
@@ -253,7 +253,7 @@ static struct tty_driver *ice_gnss_create_tty_driver(struct ice_pf *pf)int err; tty_driver =tty_alloc_driver (1 ,TTY_DRIVER_REAL_RAW ); -if (!tty_driver) { +if (IS_ERR (tty_driver)) {dev_err (ice_pf_to_dev (pf),"Failed to allocate memory for GNSS TTY\n" );return NULL ; }
Signature · 1 line
2.20.1
Tony Nguyen
maintainerPATCH 1/1 ice: gnss: fix a NULL vs IS_ERR() check
Hi Dan,
Quoted 2 lines · Dan Carpenter
The
tty_alloc_driver()function returns error pointers, it never returns NULL.
We already have a fix patch that also addresses another of the same issue.
https://patchwork.ozlabs.org/project/intel-wired-lan/patch/20220305090430.3078757-1-yangyingliang at huawei.com/
Thanks,
Tony
Quoted 2 lines
Fixes 43113ff73453 ("ice: add TTY for GNSS module for E810T device")Signed-off-by Dan Carpenter <[email protected]>