lkml.org 
[lkml]   [2022]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] platform/chrome: check *dest of memcpy
On Tue, May 17, 2022 at 05:55:21PM +0800, Yuanjun Gong wrote:
> From: Gong Yuanjun <ruc_gongyuanjun@163.com>
>
> In regulator/cros-ec-regulator.c, cros_ec_cmd is sometimes called
> with *indata set to NULL.
>
> static int cros_ec_regulator_enable(struct regulator_dev *dev){
> ...
> cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_ENABLE, &cmd,
> sizeof(cmd), NULL, 0)
> ...}
>
> Don't do memcpy if indata is NULL.

The fix makes less sense to me. Did you find somewhere that `indata` is NULL
but `insize` is not 0?

\
 
 \ /
  Last update: 2022-05-18 05:57    [W:0.087 / U:0.916 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site