mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-17 22:49:02 +00:00
cmd: spi: check return value of strdup
Check return value of strdup. Signed-off-by: Peng Fan <van.freenix@gmail.com> Cc: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Heiko Schocher <hs@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Stefan Roese <sr@denx.de> Cc: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
3917c26909
commit
9caeb26c54
1 changed files with 2 additions and 0 deletions
|
@ -51,6 +51,8 @@ static int do_spi_xfer(int bus, int cs)
|
|||
|
||||
snprintf(name, sizeof(name), "generic_%d:%d", bus, cs);
|
||||
str = strdup(name);
|
||||
if (!str)
|
||||
return -ENOMEM;
|
||||
ret = spi_get_bus_and_cs(bus, cs, 1000000, mode, "spi_generic_drv",
|
||||
str, &dev, &slave);
|
||||
if (ret)
|
||||
|
|
Loading…
Add table
Reference in a new issue