Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

misc: microchip: pci1xxxx: Fix some NULL vs IS_ERR() bugs

The devm_nvmem_register() function returns error pointers. It never
returns NULL. Update the checks accordingly.

Fixes: 0969001569e4 ("misc: microchip: pci1xxxx: Add support to read and write into PCI1XXXX OTP via NVMEM sysfs")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/043df330-222b-4c2c-ae19-ed2f731bfe0b@moroto.mountain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dan Carpenter and committed by
Greg Kroah-Hartman
5a652fe5 1314e122

+4 -4
+4 -4
drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c
··· 379 379 380 380 priv->nvmem_eeprom = devm_nvmem_register(&aux_dev->dev, 381 381 &priv->nvmem_config_eeprom); 382 - if (!priv->nvmem_eeprom) 383 - return -ENOMEM; 382 + if (IS_ERR(priv->nvmem_eeprom)) 383 + return PTR_ERR(priv->nvmem_eeprom); 384 384 } 385 385 386 386 release_sys_lock(priv); ··· 398 398 399 399 priv->nvmem_otp = devm_nvmem_register(&aux_dev->dev, 400 400 &priv->nvmem_config_otp); 401 - if (!priv->nvmem_otp) 402 - return -ENOMEM; 401 + if (IS_ERR(priv->nvmem_otp)) 402 + return PTR_ERR(priv->nvmem_otp); 403 403 404 404 return ret; 405 405 }