LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: ChiaWei Wang <chiawei_wang@aspeedtech.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	"kbuild@lists.01.org" <kbuild@lists.01.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"joel@jms.id.au" <joel@jms.id.au>,
	"andrew@aj.id.au" <andrew@aj.id.au>,
	"cyrilbur@gmail.com" <cyrilbur@gmail.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-aspeed@lists.ozlabs.org" <linux-aspeed@lists.ozlabs.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>
Cc: "lkp@intel.com" <lkp@intel.com>,
	"kbuild-all@lists.01.org" <kbuild-all@lists.01.org>
Subject: RE: [PATCH 1/2] soc: aspeed: Add LPC mailbox support
Date: Tue, 17 Aug 2021 02:37:13 +0000	[thread overview]
Message-ID: <HK0PR06MB3779008AC59C277899C95D1291FE9@HK0PR06MB3779.apcprd06.prod.outlook.com> (raw)
In-Reply-To: <202108160813.GOZ1P4Y8-lkp@intel.com>

Hi Dan,

> -----Original Message-----
> From: Dan Carpenter <dan.carpenter@oracle.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@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.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


  reply	other threads:[~2021-08-17  2:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-13  5:47 [PATCH 0/2] " Chia-Wei Wang
2021-08-13  5:47 ` [PATCH 1/2] soc: " Chia-Wei Wang
2021-08-15 19:05   ` kernel test robot
2021-08-16  9:40   ` Dan Carpenter
2021-08-17  2:37     ` ChiaWei Wang [this message]
2021-08-13  5:47 ` [PATCH 2/2] ARM: dts: aspeed: Add mailbox to device tree Chia-Wei Wang

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=HK0PR06MB3779008AC59C277899C95D1291FE9@HK0PR06MB3779.apcprd06.prod.outlook.com \
    --to=chiawei_wang@aspeedtech.com \
    --cc=andrew@aj.id.au \
    --cc=cyrilbur@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devicetree@vger.kernel.org \
    --cc=joel@jms.id.au \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=robh+dt@kernel.org \
    --subject='RE: [PATCH 1/2] soc: aspeed: Add LPC mailbox support' \
    /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

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).