Skip to content

Commit 30f96b2

Browse files
Daniil Dulovij-intel
authored andcommitted
platform/mellanox: mlxreg-hotplug: Remove redundant NULL-check
Pointer item is checked fo NULL at mlxreg_hotplug_work_helper() and then it is dereferenced to produce dev_err(). This pointer is also dereferenced before calling this function and should never be NULL except some piece of hardware is broken as it is said in the comment before the check. So, this check can be safely removed. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: c6acad6 ("platform/mellanox: mlxreg-hotplug: Modify to use a regmap interface") Signed-off-by: Daniil Dulov <[email protected]> Reviewed-by: Vadim Pasternak <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 8362e86 commit 30f96b2

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

drivers/platform/mellanox/mlxreg-hotplug.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -348,20 +348,6 @@ mlxreg_hotplug_work_helper(struct mlxreg_hotplug_priv_data *priv,
348348
u32 regval, bit;
349349
int ret;
350350

351-
/*
352-
* Validate if item related to received signal type is valid.
353-
* It should never happen, excepted the situation when some
354-
* piece of hardware is broken. In such situation just produce
355-
* error message and return. Caller must continue to handle the
356-
* signals from other devices if any.
357-
*/
358-
if (unlikely(!item)) {
359-
dev_err(priv->dev, "False signal: at offset:mask 0x%02x:0x%02x.\n",
360-
item->reg, item->mask);
361-
362-
return;
363-
}
364-
365351
/* Mask event. */
366352
ret = regmap_write(priv->regmap, item->reg + MLXREG_HOTPLUG_MASK_OFF,
367353
0);

0 commit comments

Comments
 (0)