From: kernel test robot <lkp@intel.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Pavel Machek" <pavel@ucw.cz>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
linux-leds@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH 1/2] leds: trigger: Fix error path to not unlock the unlocked mutex
Date: Fri, 19 Feb 2021 18:38:12 +0800 [thread overview]
Message-ID: <202102191839.1khFWcXO-lkp@intel.com> (raw)
In-Reply-To: <20210219082955.5007-1-u.kleine-koenig@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 4839 bytes --]
Hi "Uwe,
I love your patch! Perhaps something to improve:
[auto build test WARNING on tty/tty-testing]
[also build test WARNING on next-20210218]
[cannot apply to pavel-linux-leds/for-next staging/staging-testing v5.11]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Uwe-Kleine-K-nig/leds-trigger-Fix-error-path-to-not-unlock-the-unlocked-mutex/20210219-163217
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
config: powerpc-randconfig-r032-20210219 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# https://github.com/0day-ci/linux/commit/f13a575b98965827ab968d1c88d98c6b044d4492
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Uwe-Kleine-K-nig/leds-trigger-Fix-error-path-to-not-unlock-the-unlocked-mutex/20210219-163217
git checkout f13a575b98965827ab968d1c88d98c6b044d4492
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/leds/trigger/ledtrig-tty.c:70:1: warning: unused label 'out_unlock' [-Wunused-label]
out_unlock:
^~~~~~~~~~~
1 warning generated.
vim +/out_unlock +70 drivers/leds/trigger/ledtrig-tty.c
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 39
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 40 static ssize_t ttyname_store(struct device *dev,
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 41 struct device_attribute *attr, const char *buf,
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 42 size_t size)
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 43 {
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 44 struct ledtrig_tty_data *trigger_data = led_trigger_get_drvdata(dev);
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 45 char *ttyname;
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 46 ssize_t ret = size;
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 47 bool running;
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 48
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 49 if (size > 0 && buf[size - 1] == '\n')
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 50 size -= 1;
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 51
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 52 if (size) {
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 53 ttyname = kmemdup_nul(buf, size, GFP_KERNEL);
f13a575b989658 Uwe Kleine-König 2021-02-19 54 if (!ttyname)
f13a575b989658 Uwe Kleine-König 2021-02-19 55 return -ENOMEM;
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 56 } else {
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 57 ttyname = NULL;
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 58 }
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 59
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 60 mutex_lock(&trigger_data->mutex);
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 61
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 62 running = trigger_data->ttyname != NULL;
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 63
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 64 kfree(trigger_data->ttyname);
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 65 tty_kref_put(trigger_data->tty);
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 66 trigger_data->tty = NULL;
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 67
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 68 trigger_data->ttyname = ttyname;
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 69
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 @70 out_unlock:
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 71 mutex_unlock(&trigger_data->mutex);
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 72
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 73 if (ttyname && !running)
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 74 ledtrig_tty_restart(trigger_data);
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 75
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 76 return ret;
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 77 }
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 78 static DEVICE_ATTR_RW(ttyname);
fd4a641ac88fbb Uwe Kleine-König 2021-01-13 79
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36144 bytes --]
prev parent reply other threads:[~2021-02-19 10:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-19 8:29 [PATCH 1/2] leds: trigger: Fix error path to not unlock the unlocked mutex Uwe Kleine-König
2021-02-19 8:29 ` [PATCH 2/2] leds: trigger/tty: Use led_set_brightness_sync() from workqueue Uwe Kleine-König
2021-02-19 9:46 ` Pavel Machek
2021-02-19 9:52 ` Uwe Kleine-König
2021-02-19 10:00 ` Pavel Machek
2021-02-19 10:41 ` Greg Kroah-Hartman
2021-02-19 11:23 ` Pavel Machek
2021-02-19 9:46 ` [PATCH 1/2] leds: trigger: Fix error path to not unlock the unlocked mutex Pavel Machek
2021-02-19 10:38 ` kernel test robot [this message]
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=202102191839.1khFWcXO-lkp@intel.com \
--to=lkp@intel.com \
--cc=clang-built-linux@googlegroups.com \
--cc=gregkh@linuxfoundation.org \
--cc=kbuild-all@lists.01.org \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=u.kleine-koenig@pengutronix.de \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).