Re: [PATCH 2/4] thermal: imx: Add support for reading OCOTP through nvmem

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

 






On 14/07/17 11:49, Leonard Crestez wrote:
+	}
+	memcpy(val, buf, sizeof(*val));
This can overflow the memory allocated to val, we should be careful here
not to do so.
limit this to sizeof(u32) should be good. Also add some sanity checks to
make sure that len is atleast 4 bytes.
I'm not sure what you mean, isn't this already done? There is an
explicit check above that the read len is exactly as expected. It's
just that the limit is written as sizeof(*val) rather than sizeof(u32).

Opps, I overlooked the type.. it looks okay.

thanks,
srini

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux