[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220316204024.3201500-4-anthony.l.nguyen@intel.com>
Date: Wed, 16 Mar 2022 13:40:23 -0700
From: Tony Nguyen <anthony.l.nguyen@...el.com>
To: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com
Cc: Yang Yingliang <yangyingliang@...wei.com>, netdev@...r.kernel.org,
anthony.l.nguyen@...el.com, wojciech.drewek@...el.com,
pablo@...filter.org, laforge@...monks.org,
osmocom-net-gprs@...ts.osmocom.org, Hulk Robot <hulkci@...wei.com>,
Gurucharan <gurucharanx.g@...el.com>
Subject: [PATCH net-next 3/4] ice: fix return value check in ice_gnss.c
From: Yang Yingliang <yangyingliang@...wei.com>
kthread_create_worker() and tty_alloc_driver() return ERR_PTR()
and never return NULL. The NULL test in the return value check
should be replaced with IS_ERR().
Fixes: 43113ff73453 ("ice: add TTY for GNSS module for E810T device")
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
Tested-by: Gurucharan <gurucharanx.g@...el.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@...el.com>
---
drivers/net/ethernet/intel/ice/ice_gnss.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_gnss.c b/drivers/net/ethernet/intel/ice/ice_gnss.c
index 755e1580f368..35579cf4283f 100644
--- a/drivers/net/ethernet/intel/ice/ice_gnss.c
+++ b/drivers/net/ethernet/intel/ice/ice_gnss.c
@@ -125,7 +125,7 @@ static struct gnss_serial *ice_gnss_struct_init(struct ice_pf *pf)
* writes.
*/
kworker = kthread_create_worker(0, "ice-gnss-%s", dev_name(dev));
- if (!kworker) {
+ if (IS_ERR(kworker)) {
kfree(gnss);
return NULL;
}
@@ -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;
}
--
2.31.1
Powered by blists - more mailing lists