mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 23:51:33 +00:00
fsl/sata: correctly identify failed malloc
After allocating sata->cmd_hdr_tbl_offset we have to check this variable and not variable sata. The problem was indicated by cppcheck. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
0e0de24b07
commit
7a931b958e
1 changed files with 1 additions and 1 deletions
|
@ -124,7 +124,7 @@ int init_sata(int dev)
|
||||||
length = sizeof(struct cmd_hdr_tbl);
|
length = sizeof(struct cmd_hdr_tbl);
|
||||||
align = SATA_HC_CMD_HDR_TBL_ALIGN;
|
align = SATA_HC_CMD_HDR_TBL_ALIGN;
|
||||||
sata->cmd_hdr_tbl_offset = (void *)malloc(length + align);
|
sata->cmd_hdr_tbl_offset = (void *)malloc(length + align);
|
||||||
if (!sata) {
|
if (!sata->cmd_hdr_tbl_offset) {
|
||||||
printf("alloc the command header failed\n\r");
|
printf("alloc the command header failed\n\r");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue