[PATCH linux dev-4.7] drivers: fsi: scom: Zero out user buffer first
Andrew Geissler
geissonator at gmail.com
Wed Feb 22 14:21:29 AEDT 2017
On Tue, Feb 21, 2017 at 11:02 AM, Eddie James
<eajames at linux.vnet.ibm.com> wrote:
> From: "Edward A. James" <eajames at us.ibm.com>
>
> Scom data is just bit-wise OR'd with the user buffer, so it needs to be
> set to 0 first.
>
> Signed-off-by: Edward A. James <eajames at us.ibm.com>
> ---
> drivers/fsi/fsi-scom.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c
> index 51b3dc3..ed3b98e 100644
> --- a/drivers/fsi/fsi-scom.c
> +++ b/drivers/fsi/fsi-scom.c
> @@ -85,6 +85,7 @@ static int get_scom(struct scom_device *scom_dev, uint64_t *value,
> uint32_t result, data;
> int rc;
>
> + *value = 0ULL;
> data = addr;
> rc = fsi_device_write(scom_dev->fsi_dev, SCOM_CMD_REG, &data,
> sizeof(uint32_t));
> --
> 1.8.3.1
>
Looks good!
Acked-by: Andrew Geissler <geissonator at gmail.com>
Tested-by: Andrew Geissler <geissonator at gmail.com>
More information about the openbmc
mailing list