Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1325079

Re: [PATCH] hid:Add missing error checking in mt_probe for creating sysfs_create_group

From Jiri Kosina <jikos@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] hid:Add missing error checking in mt_probe for creating sysfs_create_group
Date 2016-02-03 10:20 +0100
Message-ID <qY1Lr-8sb-11@gated-at.bofh.it> (permalink)
References <qY0Z4-7Sl-27@gated-at.bofh.it> <qY0Z4-7Sl-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: [PATCH] hid:Add missing error checking in mt_probe for creating  sysfs_create_group Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-02-03 09:30 +0100
  Re: [PATCH] hid:Add missing error checking in mt_probe for creating  sysfs_create_group Jiri Kosina <jikos@kernel.org> - 2016-02-03 10:20 +0100

csiph-web