devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Leonard Crestez <leonard.crestez@nxp.com>
Cc: "Shawn Guo" <shawnguo@kernel.org>,
	"Zhang Rui" <rui.zhang@intel.com>,
	"Eduardo Valentin" <edubezval@gmail.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Lothar Waßmann" <LW@KARO-electronics.de>,
	"Fabio Estevam" <fabio.estevam@nxp.com>,
	"Dong Aisheng" <aisheng.dong@nxp.com>,
	"Bai Ping" <ping.bai@nxp.com>,
	"Anson Huang" <Anson.Huang@nxp.com>,
	"Octavian Purdila" <octavian.purdila@nxp.com>,
	linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] thermal: imx: Add support for reading OCOTP through nvmem
Date: Fri, 14 Jul 2017 11:54:11 +0100	[thread overview]
Message-ID: <4ad5c6dd-8179-360f-9a90-51f13565956f@linaro.org> (raw)
In-Reply-To: <1500029388.11612.54.camel@nxp.com>



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
> 

  reply	other threads:[~2017-07-14 10:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-06 13:20 [PATCH 0/4] thermal: imx: Add nvmem-cells binding on imx6sx Leonard Crestez
     [not found] ` <cover.1499347157.git.leonard.crestez-3arQi8VN3Tc@public.gmane.org>
2017-07-06 13:20   ` [PATCH 1/4] thermal: imx: Add nvmem-cells alternate binding for OCOTP access Leonard Crestez
2017-07-10 13:29     ` Rob Herring
2017-07-06 13:20 ` [PATCH 2/4] thermal: imx: Add support for reading OCOTP through nvmem Leonard Crestez
     [not found]   ` <68b476b35b0c0cbce21da0e87338323bb77e9bc4.1499347157.git.leonard.crestez-3arQi8VN3Tc@public.gmane.org>
2017-07-12  6:36     ` Shawn Guo
2017-07-14  8:48       ` Srinivas Kandagatla
     [not found]         ` <3dd43cba-02f2-204c-c3a2-582827018ef8-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-07-14 10:49           ` Leonard Crestez
2017-07-14 10:54             ` Srinivas Kandagatla [this message]
2017-07-06 13:20 ` [PATCH 3/4] ARM: dts: imx6sx: Use nvmem-cells for tempmon Leonard Crestez
     [not found]   ` <6dc9bb756daf75bb26648b06b204872f71b3a548.1499347157.git.leonard.crestez-3arQi8VN3Tc@public.gmane.org>
2017-07-12  6:40     ` Shawn Guo
2017-07-06 13:20 ` [PATCH 4/4] ARM: dts: imx6ul: Add imx6ul-tempmon Leonard Crestez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ad5c6dd-8179-360f-9a90-51f13565956f@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=Anson.Huang@nxp.com \
    --cc=LW@KARO-electronics.de \
    --cc=aisheng.dong@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=edubezval@gmail.com \
    --cc=fabio.estevam@nxp.com \
    --cc=leonard.crestez@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=octavian.purdila@nxp.com \
    --cc=ping.bai@nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).