lkml.org 
[lkml]   [2021]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] i2c: don't pass 0 nmsgs to i2c_transfer
> -		if (rdwr_arg.nmsgs > I2C_RDWR_IOCTL_MAX_MSGS)
> + if (!rdwr_arg.nmsgs || rdwr_arg.nmsgs > I2C_RDWR_IOCTL_MAX_MSGS)
> return -EINVAL;

Shouldn't we check the msgs pointer as well while we are here? Like in
the non-compat IOCTL code:

443 if (!rdwr_arg.msgs || rdwr_arg.nmsgs == 0)
444 return -EINVAL;


[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-12-30 23:20    [W:0.080 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site