Unverified Commit 80a0681e authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!7579 powerpc/powernv: Add a null pointer check to scom_debug_init_one()

parents 7ebdc966 70785847
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -165,6 +165,11 @@ static int scom_debug_init_one(struct dentry *root, struct device_node *dn,
	ent->chip = chip;
	snprintf(ent->name, 16, "%08x", chip);
	ent->path.data = (void *)kasprintf(GFP_KERNEL, "%pOF", dn);
	if (!ent->path.data) {
		kfree(ent);
		return -ENOMEM;
	}

	ent->path.size = strlen((char *)ent->path.data);

	dir = debugfs_create_dir(ent->name, root);