net: cpsw: Add NULL pointer check
PATCH 1/1 net: cpsw: Add NULL pointer check
Add null pointer check to take care of out of memory errors.
Signed-off-by Faiz Abbas <[email protected]>
--- drivers/net/ti/cpsw.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ti/cpsw.c +3 -0
@@ -1223,6 +1223,9 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev)int ret; data =calloc (1 ,sizeof (struct cpsw_platform_data )); +if (!data) +return -ENOMEM ; + pdata->priv_pdata = data; pdata->iobase =dev_read_addr (dev); data->version =CPSW_CTRL_VERSION_2 ;
Signature · 1 line
2.19.2
PATCH 1/1 net: cpsw: Add NULL pointer check
Quoted 13 lines · Faiz Abbas
Add null pointer check to take care of out of memory errors.
Signed-off-by Faiz Abbas <[email protected]>--- drivers/net/ti/cpsw.c | 3 +++ 1 file changed, 3 insertions(+)drivers/net/ti/cpsw.c +0
-0
drivers/net/ti/cpsw.c static int cpsw_eth_ofdata_to_platdata(struct udevice *dev) · line 1231
Quoted 9 lines
drivers/net/ti/cpsw.c +3
-0@@ -1223,6 +1223,9 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev)int ret; data =calloc (1 ,sizeof (struct cpsw_platform_data )); +if (!data) +return -ENOMEM ; + pdata->priv_pdata = data; pdata->iobase =dev_read_addr (dev); data->version =CPSW_CTRL_VERSION_2 ;
Reviewed-by Grygorii Strashko <[email protected]>
Signature · 2 lines
Best regards, grygorii
PATCH 1/1 net: cpsw: Add NULL pointer check
In reply to Faiz AbbasQuoted 4 lines · Faiz Abbas
Add null pointer check to take care of out of memory errors.
Signed-off-by Faiz Abbas <[email protected]>Reviewed-by Grygorii Strashko <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191203/fa493017/attachment.sig>