Re: [PATCH v2] i2c: don't pass 0 nmsgs to i2c_transfer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -		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;


Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux