Add check for the return value of alloc_can_err_skb in order to
avoid NULL pointer dereference.
Fixes: 8537257874e9 ("can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces")
Signed-off-by: Jiasheng Jiang <redacted>
---
drivers/net/can/usb/etas_es58x/es58x_core.c | 2 ++
1 file changed, 2 insertions(+)
From: Vincent MAILHOL <hidden> Date: 2023-09-01 10:53:37
On Fri. 1 Sept 2023 at 19:22, Jiasheng Jiang [off-list ref] wrote:
quoted hunk
Add check for the return value of alloc_can_err_skb in order to
avoid NULL pointer dereference.
Fixes: 8537257874e9 ("can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces")
Signed-off-by: Jiasheng Jiang <redacted>
---
drivers/net/can/usb/etas_es58x/es58x_core.c | 2 ++
1 file changed, 2 insertions(+)
NAK.
The checks on skb or cf are skipped intentionally here in order to
continue the error handling.
Later in this function, all the access to skb or cf and guarded by an:
if (cf)
And if cf is not NULL, skb is also guaranteed not to be NULL. For
further details, please refer to this commit:
https://git.kernel.org/torvalds/c/c8129487441e
Yours sincerely,
Vincent Mailhol
switch (error) {
case ES58X_ERR_OK: /* 0: No error */
--
2.25.1
Add check for the return value of alloc_can_err_skb in order to
avoid NULL pointer dereference.
Fixes: 8537257874e9 ("can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces")
Signed-off-by: Jiasheng Jiang <redacted>
---
drivers/net/can/usb/etas_es58x/es58x_core.c | 2 ++
1 file changed, 2 insertions(+)