drivers: can: socket: Use proper filter when setsockopt is called
Check that the received filter is can_filter type when setsockopt() is called. Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
c8dfdb63f9
commit
fc36d56aca
2 changed files with 22 additions and 6 deletions
|
@ -85,10 +85,7 @@ static inline int socket_can_setsockopt(struct device *dev, void *obj,
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (optlen != sizeof(struct can_filter)) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
__ASSERT_NO_MSG(optlen == sizeof(struct zcan_filter));
|
||||
|
||||
ret = can_attach_msgq(socket_context->can_dev, socket_context->msgq,
|
||||
optval);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue