LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Chia-Wei Wang <chiawei_wang@aspeedtech.com>,
	robh+dt@kernel.org, joel@jms.id.au, andrew@aj.id.au,
	cyrilbur@gmail.com, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	openbmc@lists.ozlabs.org
Cc: lkp@intel.com, kbuild-all@lists.01.org
Subject: Re: [PATCH 1/2] soc: aspeed: Add LPC mailbox support
Date: Mon, 16 Aug 2021 12:40:55 +0300	[thread overview]
Message-ID: <202108160813.GOZ1P4Y8-lkp@intel.com> (raw)
In-Reply-To: <20210813054758.13189-2-chiawei_wang@aspeedtech.com>

Hi Chia-Wei,

url:    https://github.com/0day-ci/linux/commits/Chia-Wei-Wang/aspeed-Add-LPC-mailbox-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;

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


  parent reply	other threads:[~2021-08-16  9:41 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 [this message]
2021-08-17  2:37     ` ChiaWei Wang
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=202108160813.GOZ1P4Y8-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=andrew@aj.id.au \
    --cc=chiawei_wang@aspeedtech.com \
    --cc=cyrilbur@gmail.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).