Skip to content

Commit

Permalink
bus/dpaa: verify strdup return
Browse files Browse the repository at this point in the history
[ upstream commit 2729fa6654b328bb4b9a0ede6d1e1019bd6caf0c ]

Add verify strdup return value logic.

Fixes: e79df83 ("bus/dpaa: support hotplug ops")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Sachin Saxena <sachin.saxena@nxp.com>
  • Loading branch information
fengchengwen authored and kevintraynor committed Mar 5, 2024
1 parent 7fc3309 commit f128469
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/bus/dpaa/dpaa_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,10 @@ dpaa_bus_dev_iterate(const void *start, const char *str,

/* Now that name=device_name format is available, split */
dup = strdup(str);
if (dup == NULL) {
DPAA_BUS_DEBUG("Dup string (%s) failed!\n", str);
return NULL;
}
dev_name = dup + strlen("name=");

if (start != NULL) {
Expand Down

0 comments on commit f128469

Please sign in to comment.