can: raw: fix getsockopt() for new CAN_RAW_XL_VCID_OPTS
The code for the CAN_RAW_XL_VCID_OPTS getsockopt() was incompletely adopted from the CAN_RAW_FILTER getsockopt(). Add the missing put_user() and return statements. Flagged by Smatch. Fixes: c83c22ec1493 ("can: canxl: add virtual CAN network identifier support") Reported-by: Simon Horman <horms@kernel.org> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Link: https://lore.kernel.org/all/20240219200021.12113-1-socketcan@hartkopp.net Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
a93fca9201
commit
c8fba5d6df
@ -835,7 +835,9 @@ static int raw_getsockopt(struct socket *sock, int level, int optname,
|
||||
if (copy_to_user(optval, &ro->raw_vcid_opts, len))
|
||||
err = -EFAULT;
|
||||
}
|
||||
break;
|
||||
if (!err)
|
||||
err = put_user(len, optlen);
|
||||
return err;
|
||||
|
||||
case CAN_RAW_JOIN_FILTERS:
|
||||
if (len > sizeof(int))
|
||||
|
Loading…
x
Reference in New Issue
Block a user