Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gtp: fix a potential NULL pointer dereference
[ Upstream commit defd8b3 ] When sockfd_lookup() fails, gtp_encap_enable_socket() returns a NULL pointer, but its callers only check for error pointers thus miss the NULL pointer case. Fix it by returning an error pointer with the error code carried from sockfd_lookup(). (I found this bug during code inspection.) Fixes: 1e3a3ab ("gtp: make GTP sockets in gtp_newlink optional") Cc: Andreas Schultz <[email protected]> Cc: Harald Welte <[email protected]> Signed-off-by: Cong Wang <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Pablo Neira Ayuso <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
- Loading branch information