Skip to content

Commit

Permalink
bus/fslmc: verify strdup return
Browse files Browse the repository at this point in the history
[ upstream commit 180d52bc7de2395ce9f4e5a707f4d8bb52be2fe4 ]

Add verify strdup return value logic.

Fixes: e67a616 ("bus/fslmc: support device iteration")

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

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

if (start != NULL) {
Expand Down

0 comments on commit f0becad

Please sign in to comment.