mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-18 23:09:29 +02:00
soc: imx9: devm_kasprintf error handling
Add error handling to devm_kasprintf functions in imx9_soc_probe(). Assisted-by: gkh_clanker_2000 Cc: Frank Li <Frank.Li@nxp.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Pengutronix Kernel Team <kernel@pengutronix.de> Cc: Fabio Estevam <festevam@gmail.com> Cc: Peng Fan <peng.fan@nxp.com> Cc: Shawn Guo <shawnguo@kernel.org> Cc: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Signed-off-by: Griffin Kroah-Hartman <griffin@kroah.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Frank Li <Frank.Li@nxp.com>
This commit is contained in:
committed by
Frank Li
parent
9818b99c12
commit
116165611d
@@ -35,6 +35,8 @@ static int imx9_soc_probe(struct platform_device *pdev)
|
||||
return dev_err_probe(dev, err, "%s: missing model property\n", __func__);
|
||||
|
||||
attr->family = devm_kasprintf(dev, GFP_KERNEL, "Freescale i.MX");
|
||||
if (!attr->family)
|
||||
return -ENOMEM;
|
||||
|
||||
/*
|
||||
* Retrieve the soc id, rev & uid info:
|
||||
@@ -52,11 +54,18 @@ static int imx9_soc_probe(struct platform_device *pdev)
|
||||
rev_minor = SOC_REV_MINOR(res.a1);
|
||||
|
||||
attr->soc_id = devm_kasprintf(dev, GFP_KERNEL, "i.MX%2x", soc_id);
|
||||
if (!attr->soc_id)
|
||||
return -ENOMEM;
|
||||
|
||||
attr->revision = devm_kasprintf(dev, GFP_KERNEL, "%d.%d", rev_major, rev_minor);
|
||||
if (!attr->revision)
|
||||
return -ENOMEM;
|
||||
|
||||
uid127_64 = res.a2;
|
||||
uid63_0 = res.a3;
|
||||
attr->serial_number = devm_kasprintf(dev, GFP_KERNEL, "%016llx%016llx", uid127_64, uid63_0);
|
||||
if (!attr->serial_number)
|
||||
return -ENOMEM;
|
||||
|
||||
sdev = soc_device_register(attr);
|
||||
if (IS_ERR(sdev))
|
||||
|
||||
Reference in New Issue
Block a user