mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-25 11:55:37 +00:00
char: xilinx_hwicap: Fix NULL vs IS_ERR() bug
[ Upstream commit316459ba40
] The devm_platform_ioremap_resource() function returns error pointers. It never returns NULL. Update the check accordingly. Fixes:6723718321
("char: xilinx_hwicap: Modernize driver probe") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Acked-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/ef647a9c-b1b7-4338-9bc0-28165ec2a367@moroto.mountain Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
e1100e7a5a
commit
6595eae98a
1 changed files with 2 additions and 2 deletions
|
@ -639,8 +639,8 @@ static int hwicap_setup(struct platform_device *pdev, int id,
|
|||
dev_set_drvdata(dev, (void *)drvdata);
|
||||
|
||||
drvdata->base_address = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (!drvdata->base_address) {
|
||||
retval = -ENODEV;
|
||||
if (IS_ERR(drvdata->base_address)) {
|
||||
retval = PTR_ERR(drvdata->base_address);
|
||||
goto failed;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue