Skip to contentSkip to conversation

ice: gnss: fix a NULL vs IS_ERR() check

PATCH New Dan Carpenter 2 participants 2 messages Mar 7, 2022 – Mar 8, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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")
---
 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
index 755e1580f368..333c085a228a 100644
@@ -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
maintainer
#1 lore raw

PATCH 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")