We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 274e58c commit e694d2bCopy full SHA for e694d2b
drivers/soc/qcom/socinfo.c
@@ -786,10 +786,16 @@ static int qcom_socinfo_probe(struct platform_device *pdev)
786
qs->attr.revision = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%u.%u",
787
SOCINFO_MAJOR(le32_to_cpu(info->ver)),
788
SOCINFO_MINOR(le32_to_cpu(info->ver)));
789
- if (offsetof(struct socinfo, serial_num) <= item_size)
+ if (!qs->attr.soc_id || qs->attr.revision)
790
+ return -ENOMEM;
791
+
792
+ if (offsetof(struct socinfo, serial_num) <= item_size) {
793
qs->attr.serial_number = devm_kasprintf(&pdev->dev, GFP_KERNEL,
794
"%u",
795
le32_to_cpu(info->serial_num));
796
+ if (!qs->attr.serial_number)
797
798
+ }
799
800
qs->soc_dev = soc_device_register(&qs->attr);
801
if (IS_ERR(qs->soc_dev))
0 commit comments