mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
soc: fsl: guts: Add a NULL check for devm_kasprintf()
devm_kasprintf() may fail, so we should better add a NULL check and propagate an error on failure. Signed-off-by: Fabio Estevam <[email protected]> Acked-by: Yangbo Lu <[email protected]> Signed-off-by: Li Yang <[email protected]>
This commit is contained in:
parent
6ea0acfd07
commit
14b055f439
1 changed files with 6 additions and 0 deletions
|
|
@ -167,10 +167,16 @@ static int fsl_guts_probe(struct platform_device *pdev)
|
|||
} else {
|
||||
soc_dev_attr.family = devm_kasprintf(dev, GFP_KERNEL, "QorIQ");
|
||||
}
|
||||
if (!soc_dev_attr.family)
|
||||
return -ENOMEM;
|
||||
soc_dev_attr.soc_id = devm_kasprintf(dev, GFP_KERNEL,
|
||||
"svr:0x%08x", svr);
|
||||
if (!soc_dev_attr.soc_id)
|
||||
return -ENOMEM;
|
||||
soc_dev_attr.revision = devm_kasprintf(dev, GFP_KERNEL, "%d.%d",
|
||||
(svr >> 4) & 0xf, svr & 0xf);
|
||||
if (!soc_dev_attr.revision)
|
||||
return -ENOMEM;
|
||||
|
||||
soc_dev = soc_device_register(&soc_dev_attr);
|
||||
if (IS_ERR(soc_dev))
|
||||
|
|
|
|||
Loading…
Reference in a new issue