Skip to contentSkip to conversation

raw/skeleton: remove useless check

PATCH Applied David Marchand 2 participants 3 messages Oct 4, 2022 – Oct 5, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 raw/skeleton: remove useless check

As reported by Coverity, this check is pointless since dev is already dereferenced earlier. Besides, dev is passed by the rawdev layer and can't be NULL.

Note: the issue was probably present before the incriminated commit. It is unclear why Coverity would start complaining about this now.

Coverity issue: 380991

Fixes 8f1d23ece06a ("eal: deprecate RTE_FUNC_PTR_* macros")
---
 drivers/raw/skeleton/skeleton_rawdev.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/raw/skeleton/skeleton_rawdev.c +0 -3
index 1d043bec5d..b2ca1cc5cd 100644
@@ -475,9 +475,6 @@ static int skeleton_rawdev_firmware_status_get(struct rte_rawdev *dev,
 
 	skeldev = skeleton_rawdev_get_priv(dev);
 
-	if (dev == NULL)
-		return -EINVAL;
-
 	if (status_info)
 		memcpy(status_info, &skeldev->fw.firmware_state,
 			sizeof(enum skeleton_firmware_state));
Signature · 1 line
2.37.3
author Acked-by Hemant Agrawal on v1 1/1 Applied
#2 lore raw
In reply to David Marchand
Quoted 5 lines · David Marchand

As reported by Coverity, this check is pointless since dev is already dereferenced earlier. Besides, dev is passed by the rawdev layer and can't be NULL.

Quoted 7 lines

Note: the issue was probably present before the incriminated commit. It is unclear why Coverity would start complaining about this now.

Coverity issue: 380991

Fixes 8f1d23ece06a ("eal: deprecate RTE_FUNC_PTR_* macros")

Applied, thanks.

Signature · 1 line
David Marchand