> > + for (i = 0; i < I2C_RDRW_IOCTL_MAX_MSGS; i++) > > + msgs[i].buf = NULL; > > + > > If you explicitly set "buf = NULL" for zero-length messages in the > state machine as recommended in my review of the previous patch, this > is no longer needed. It is as stated in my previous mail. We should really play safe here. If we optimize too much, the cleanup loops become fragile (I tried some options) and one easily misses a case. Cleaning up is hard, we know that from Linux drivers. (For me, this is still a good example how letting the OS free memory can actually prevent bugs. But I give in already ;))
Attachment:
signature.asc
Description: Digital signature