* Re: [PATCH] hid:Add missing error checking in mt_probe for creating sysfs_create_group
[not found] <1454470263-29702-1-git-send-email-xerofoify@gmail.com>
@ 2016-02-03 8:23 ` Benjamin Tissoires
2016-02-03 9:14 ` Jiri Kosina
0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Tissoires @ 2016-02-03 8:23 UTC (permalink / raw)
To: Nicholas Krause; +Cc: jikos, linux-input, linux-kernel
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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] hid:Add missing error checking in mt_probe for creating sysfs_create_group
2016-02-03 8:23 ` [PATCH] hid:Add missing error checking in mt_probe for creating sysfs_create_group Benjamin Tissoires
@ 2016-02-03 9:14 ` Jiri Kosina
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2016-02-03 9:14 UTC (permalink / raw)
To: Benjamin Tissoires; +Cc: Nicholas Krause, linux-input, linux-kernel
On Wed, 3 Feb 2016, Benjamin Tissoires wrote:
> > 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?
Yeah. And also in case of hard failure, some cleanup would have to be done
anyway (hid_hw_start() has already happened, etc).
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-02-03 9:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1454470263-29702-1-git-send-email-xerofoify@gmail.com>
2016-02-03 8:23 ` [PATCH] hid:Add missing error checking in mt_probe for creating sysfs_create_group Benjamin Tissoires
2016-02-03 9:14 ` Jiri Kosina
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.