All of lore.kernel.org
 help / color / mirror / Atom feed
From: khali@linux-fr.org (Jean Delvare)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [patch 3/3] pc87360 - fix unchecked
Date: Sat, 23 Sep 2006 15:02:22 +0000	[thread overview]
Message-ID: <20060923170222.71cd9913.khali@linux-fr.org> (raw)
In-Reply-To: <44E73765.80603@gmail.com>

Hi Jim,

> > 3- rework sys-device-interface startup
> >     use sysfs_create_group() for 2 sensor-types which are chip-model invariant.
> >        ie all-or-nothing attribute groups
> >     other 2 groups vary too much due to configuration, etc,
> >        so we keep the loops of device_create_file(), but now check their returns.
> > 
> > Signed-off-by:   Jim Cromie  <jim.cromie at gmail.com>

I just noticed that you do not properly propagate the error value if a
device file creation actually fails:

> > diff -ruNp -X dontdiff -X exclude-diffs ab-2/drivers/hwmon/pc87360.c ab-3/drivers/hwmon/pc87360.c
> > --- ab-2/drivers/hwmon/pc87360.c	2006-08-18 17:40:35.000000000 -0600
> > +++ ab-3/drivers/hwmon/pc87360.c	2006-08-18 18:54:24.000000000 -0600

> > +	/* Register all-or-nothing sysfs groups */
> > +
> > +	if (data->innr && 
> > +	    sysfs_create_group(&client->dev.kobj,
> > +			       &pc8736x_vin_group))
> >  		goto ERROR3;

> >  	if (data->tempnr) {
> >  		for (i = 0; i < data->tempnr; i++) {
> > +			if (device_create_file(dev, &temp_input[i].dev_attr)
> > +			    || device_create_file(dev, &temp_min[i].dev_attr)
> > +			    || device_create_file(dev, &temp_max[i].dev_attr)
> > +			    || device_create_file(dev, &temp_crit[i].dev_attr)
> > +			    || device_create_file(dev, &temp_status[i].dev_attr))
> > +				goto ERROR3;

I've fixed that, modified patch is attached, I hope you like it.

-- 
Jean Delvare
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hwmon-unchecked-return-status-fixes-pc87360-3.patch
Url: http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060923/de6416cf/attachment-0001.pl 

  parent reply	other threads:[~2006-09-23 15:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-19 16:08 [lm-sensors] [patch 3/3] pc87360 - fix unchecked Jim Cromie
2006-08-20 17:30 ` Jean Delvare
2006-09-23 15:02 ` Jean Delvare [this message]
2006-09-23 21:07 ` Jim Cromie
2006-09-23 21:34 ` Jean Delvare

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=20060923170222.71cd9913.khali@linux-fr.org \
    --to=khali@linux-fr.org \
    --cc=lm-sensors@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.