It will cause null-ptr-deref if platform_get_resource() returns NULL, we need check the return value. Fixes: 17e7dc4373df ("hwmon/sis5595: Convert to a platform driver") Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx> --- drivers/hwmon/sis5595.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/hwmon/sis5595.c b/drivers/hwmon/sis5595.c index 018cb5a7651f..b664c306d087 100644 --- a/drivers/hwmon/sis5595.c +++ b/drivers/hwmon/sis5595.c @@ -579,6 +579,8 @@ static int sis5595_probe(struct platform_device *pdev) /* Reserve the ISA region */ res = platform_get_resource(pdev, IORESOURCE_IO, 0); + if (!res) + return -EINVAL; if (!devm_request_region(&pdev->dev, res->start, SIS5595_EXTENT, sis5595_driver.driver.name)) return -EBUSY; -- 2.25.1