Re: [PATCH] i2c: add extra check to safe DMA buffer helper

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

 



> How about also printing some warning if threshold is zero? Since

Hmm, not a warning because a user of a kernel can't do much about it. A
debug might make sense; it is for developers and will be compiled away
for production use.

> caller might expect that if msg->len >= threshold, they will get valid
> pointer. But they will get valid pointer if (msg->len, threshold) is
> (>0, 0) and NULL if (=0, 0). So warn them that the threshold is bogus.

Well, callers should always check for NULL because a valid pointer can
not be guaranteed (ENOMEM case). And I still don't get why would you
want a valid DMA-able pointer if the msg length is 0?

Thanks!

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux