All of lore.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: James.Bottomley@HansenPartnership.com, mdr@sgi.com,
	linux-scsi@vger.kernel.org, tomof@acm.org
Subject: Re: [PATCH 2/2] sg: handle class_device_create failure properly
Date: Mon, 14 Jan 2008 23:55:55 -0500	[thread overview]
Message-ID: <478C3CDB.3020009@torque.net> (raw)
In-Reply-To: <20080115131800Q.fujita.tomonori@lab.ntt.co.jp>

FUJITA Tomonori wrote:
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> ---
>  drivers/scsi/sg.c |   11 +++++++----
>  1 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
> index 92b4367..527e2eb 100644
> --- a/drivers/scsi/sg.c
> +++ b/drivers/scsi/sg.c
> @@ -1430,11 +1430,14 @@ sg_add(struct class_device *cl_dev, struct class_interface *cl_intf)
>  				MKDEV(SCSI_GENERIC_MAJOR, sdp->index),
>  				cl_dev->dev, "%s",
>  				disk->disk_name);
> -		if (IS_ERR(sg_class_member))
> -			printk(KERN_WARNING "sg_add: "
> -				"class_device_create failed\n");
> +		if (IS_ERR(sg_class_member)) {
> +			printk(KERN_ERR "sg_add: "
> +			       "class_device_create failed\n");
> +			error = PTR_ERR(sg_class_member);
> +			goto cdev_add_err;
> +		}
>  		class_set_devdata(sg_class_member, sdp);
> -		error = sysfs_create_link(&scsidp->sdev_gendev.kobj, 
> +		error = sysfs_create_link(&scsidp->sdev_gendev.kobj,
>  					  &sg_class_member->kobj, "generic");
>  		if (error)
>  			printk(KERN_ERR "sg_add: unable to make symlink "

Signed-off-by: Douglas Gilbert <dougg@torque.net>


      reply	other threads:[~2008-01-15  4:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-15  4:18 [PATCH 2/2] sg: handle class_device_create failure properly FUJITA Tomonori
2008-01-15  4:55 ` Douglas Gilbert [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=478C3CDB.3020009@torque.net \
    --to=dougg@torque.net \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mdr@sgi.com \
    --cc=tomof@acm.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.