[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <HK0PR06MB3779008AC59C277899C95D1291FE9@HK0PR06MB3779.apcprd06.prod.outlook.com>
Date: Tue, 17 Aug 2021 02:37:13 +0000
From: ChiaWei Wang <chiawei_wang@...eedtech.com>
To: Dan Carpenter <dan.carpenter@...cle.com>,
"kbuild@...ts.01.org" <kbuild@...ts.01.org>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"joel@....id.au" <joel@....id.au>,
"andrew@...id.au" <andrew@...id.au>,
"cyrilbur@...il.com" <cyrilbur@...il.com>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-aspeed@...ts.ozlabs.org" <linux-aspeed@...ts.ozlabs.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"openbmc@...ts.ozlabs.org" <openbmc@...ts.ozlabs.org>
CC: "lkp@...el.com" <lkp@...el.com>,
"kbuild-all@...ts.01.org" <kbuild-all@...ts.01.org>
Subject: RE: [PATCH 1/2] soc: aspeed: Add LPC mailbox support
Hi Dan,
> -----Original Message-----
> From: Dan Carpenter <dan.carpenter@...cle.com>
> Sent: Monday, August 16, 2021 5:41 PM
>
> Hi Chia-Wei,
>
> url:
> https://github.com/0day-ci/linux/commits/Chia-Wei-Wang/aspeed-Add-LPC-m
> ailbox-support/20210813-134908
> base: https://git.kernel.org/pub/scm/linux/kernel/git/joel/aspeed.git
> for-next
> config: openrisc-randconfig-m031-20210816 (attached as .config)
> compiler: or1k-linux-gcc (GCC) 11.2.0
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@...el.com>
> Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
>
> smatch warnings:
> drivers/soc/aspeed/aspeed-lpc-mbox.c:230 aspeed_mbox_ioctl() warn: maybe
> return -EFAULT instead of the bytes remaining?
>
> vim +230 drivers/soc/aspeed/aspeed-lpc-mbox.c
>
> 72c5a69dc779f5 Chia-Wei Wang 2021-08-13 214 static long
> aspeed_mbox_ioctl(struct file *file, unsigned int cmd,
> 72c5a69dc779f5 Chia-Wei Wang 2021-08-13 215
> unsigned long param)
> 72c5a69dc779f5 Chia-Wei Wang 2021-08-13 216 {
> 72c5a69dc779f5 Chia-Wei Wang 2021-08-13 217 struct aspeed_mbox
> *mbox = file_mbox(file);
> 72c5a69dc779f5 Chia-Wei Wang 2021-08-13 218 const struct
> aspeed_mbox_model *model = mbox->model;
> 72c5a69dc779f5 Chia-Wei Wang 2021-08-13 219 struct
> aspeed_mbox_ioctl_data data;
> 72c5a69dc779f5 Chia-Wei Wang 2021-08-13 220 long ret;
> 72c5a69dc779f5 Chia-Wei Wang 2021-08-13 221
> 72c5a69dc779f5 Chia-Wei Wang 2021-08-13 222 switch (cmd) {
> 72c5a69dc779f5 Chia-Wei Wang 2021-08-13 223 case
> ASPEED_MBOX_IOCTL_GET_SIZE:
> 72c5a69dc779f5 Chia-Wei Wang 2021-08-13 224 data.data =
> model->dr_num;
> 72c5a69dc779f5 Chia-Wei Wang 2021-08-13 225 ret =
> copy_to_user((void __user *)param, &data, sizeof(data));
>
> This should be:
>
> if (copy_to_user((void __user *)param, &data, sizeof(data)))
> return -EFAULT;
Will be fixed in v2 patch. Thanks for the review.
Regards,
Chiawei
>
> 72c5a69dc779f5 Chia-Wei Wang 2021-08-13 226 break;
> 72c5a69dc779f5 Chia-Wei Wang 2021-08-13 227 default:
> 72c5a69dc779f5 Chia-Wei Wang 2021-08-13 228 ret = -ENOTTY;
> 72c5a69dc779f5 Chia-Wei Wang 2021-08-13 229 }
> 72c5a69dc779f5 Chia-Wei Wang 2021-08-13 @230 return ret;
> 72c5a69dc779f5 Chia-Wei Wang 2021-08-13 231 }
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Powered by blists - more mailing lists