linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Nicholas Krause <xerofoify@gmail.com>
Cc: jikos@kernel.org, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hid:Add missing error checking in mt_probe for creating sysfs_create_group
Date: Wed, 3 Feb 2016 09:23:55 +0100	[thread overview]
Message-ID: <20160203082355.GE12345@mail.corp.redhat.com> (raw)
In-Reply-To: <1454470263-29702-1-git-send-email-xerofoify@gmail.com>

On Feb 02 2016 or thereabouts, Nicholas Krause wrote:
> This adds the missing error check in the function mt_probe for
> the call to the function sysfs_create_group for creating the
> group,mt_attrribute as based on the based input device's device
> kobject's member as otherwise we assume the sysfs directory is
> created successfully no matter the return value of
> sysfs_create_group.
> 
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
>  drivers/hid/hid-multitouch.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
> index 296d499..46ebf06 100644
> --- a/drivers/hid/hid-multitouch.c
> +++ b/drivers/hid/hid-multitouch.c
> @@ -1133,6 +1133,8 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
>  		return ret;
>  
>  	ret = sysfs_create_group(&hdev->dev.kobj, &mt_attribute_group);
> +	if (ret)
> +		return ret;

I am not particularly happy with a hard failure here in case the sysfs
group doesn't bind. The group is mainly used for debug, and I am not
sure anybody but me uses it nowadays.

Could you amend the patch to put a warning in case of a failure but
still continue?

Cheers,
Benjamin

>  
>  	mt_set_maxcontacts(hdev);
>  	mt_set_input_mode(hdev);
> -- 
> 2.5.0
> 

       reply	other threads:[~2016-02-03  8:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1454470263-29702-1-git-send-email-xerofoify@gmail.com>
2016-02-03  8:23 ` Benjamin Tissoires [this message]
2016-02-03  9:14   ` [PATCH] hid:Add missing error checking in mt_probe for creating sysfs_create_group Jiri Kosina

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=20160203082355.GE12345@mail.corp.redhat.com \
    --to=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xerofoify@gmail.com \
    /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).