All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: "linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>
Subject: Re: [PATCH] leds: triggers: return error if invalid trigger name is provided via sysfs
Date: Mon, 04 Jul 2016 08:54:02 +0200	[thread overview]
Message-ID: <577A080A.7080108@samsung.com> (raw)
In-Reply-To: <d7ef6332-73ae-b902-bdf2-d6dbcf8cc06c@gmail.com>

Hi Heiner,

On 07/01/2016 11:08 PM, Heiner Kallweit wrote:
> If an invalid trigger name is provided via sysfs currently no error
> is returned. Therefore it's not possible to determine whether the
> trigger was set successfully.
> Fix this by returning -EINVAL if no trigger is matched.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>   drivers/leds/led-triggers.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c
> index 55fa65e..c92702a 100644
> --- a/drivers/leds/led-triggers.c
> +++ b/drivers/leds/led-triggers.c
> @@ -60,6 +60,8 @@ ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr,
>   			goto unlock;
>   		}
>   	}
> +	/* we come here only if buf matches no trigger */
> +	ret = -EINVAL;
>   	up_read(&triggers_list_lock);
>
>   unlock:
>

Thanks for the patch. Applied.

-- 
Best regards,
Jacek Anaszewski

      reply	other threads:[~2016-07-04  6:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-01 21:08 [PATCH] leds: triggers: return error if invalid trigger name is provided via sysfs Heiner Kallweit
2016-07-04  6:54 ` Jacek Anaszewski [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=577A080A.7080108@samsung.com \
    --to=j.anaszewski@samsung.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-leds@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.