All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [SCSI] ufs: fix potential NULL pointer dereferencing error in ufshcd_probe.
@ 2012-05-21 14:35 Namjae Jeon
  2012-05-22 20:15 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Namjae Jeon @ 2012-05-21 14:35 UTC (permalink / raw)
  To: santoshsy, vinholikatti, santosh.sy, James.Bottomley, jBottomley,
	akpm
  Cc: linux-scsi, Namjae Jeon

Avoid dereferencing a NULL pointer if scsi_host_alloc is failed.

Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
Acked-by: Santosh Y <santoshsy@gmail.com>
---
 drivers/scsi/ufs/ufshcd.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index e47a0da..58f4ba6 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1838,7 +1838,7 @@ ufshcd_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	err = pci_request_regions(pdev, UFSHCD);
 	if (err < 0) {
 		dev_err(&pdev->dev, "request regions failed\n");
-		goto out_disable;
+		goto out_host_put;
 	}
 
 	hba->mmio_base = pci_ioremap_bar(pdev, 0);
@@ -1927,8 +1927,9 @@ out_iounmap:
 	iounmap(hba->mmio_base);
 out_release_regions:
 	pci_release_regions(pdev);
-out_disable:
+out_host_put:
 	scsi_host_put(host);
+out_disable:
 	pci_clear_master(pdev);
 	pci_disable_device(pdev);
 out_error:
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] [SCSI] ufs: fix potential NULL pointer dereferencing error in ufshcd_probe.
  2012-05-21 14:35 [PATCH] [SCSI] ufs: fix potential NULL pointer dereferencing error in ufshcd_probe Namjae Jeon
@ 2012-05-22 20:15 ` Andrew Morton
  2012-05-22 23:03   ` Namjae Jeon
  2012-05-23  8:52   ` James Bottomley
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Morton @ 2012-05-22 20:15 UTC (permalink / raw)
  To: Namjae Jeon
  Cc: santoshsy, vinholikatti, santosh.sy, James.Bottomley, jBottomley,
	linux-scsi

On Mon, 21 May 2012 10:35:36 -0400
Namjae Jeon <linkinjeon@gmail.com> wrote:

> Subject: [PATCH] [SCSI] ufs: fix potential NULL pointer dereferencing error in ufshcd_probe.

Nit: conventionally, the text inside [] is to be discarded by the patch
recipient, so the title of this patch is

	ufs: fix potential NULL pointer dereferencing error in ufshcd_probe.

which makes it look like a patch against fs/ufs/!

There is a fashion lately of people prefixing patch titles along the
lines of

  scsi: ufs: fix potential NULL pointer dereferencing error in ufshcd_probe.

or even

  drivers: scsi: ufs: fix potential NULL pointer dereferencing error in ufshcd_probe.

that's nuts, and I regularly turn this into a proper pathname - why
not?

  drivers/scsi/ufs: fix potential NULL pointer dereferencing error in ufshcd_probe.


I'll stop now :)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [SCSI] ufs: fix potential NULL pointer dereferencing error in ufshcd_probe.
  2012-05-22 20:15 ` Andrew Morton
@ 2012-05-22 23:03   ` Namjae Jeon
  2012-05-23  8:52   ` James Bottomley
  1 sibling, 0 replies; 4+ messages in thread
From: Namjae Jeon @ 2012-05-22 23:03 UTC (permalink / raw)
  To: Andrew Morton
  Cc: santoshsy, vinholikatti, santosh.sy, James.Bottomley, jBottomley,
	linux-scsi

Hi. Andrew.

I will do it next time.

Thanks for your advice.

2012/5/23, Andrew Morton <akpm@linux-foundation.org>:
> On Mon, 21 May 2012 10:35:36 -0400
> Namjae Jeon <linkinjeon@gmail.com> wrote:
>
>> Subject: [PATCH] [SCSI] ufs: fix potential NULL pointer dereferencing
>> error in ufshcd_probe.
>
> Nit: conventionally, the text inside [] is to be discarded by the patch
> recipient, so the title of this patch is
>
> 	ufs: fix potential NULL pointer dereferencing error in ufshcd_probe.
>
> which makes it look like a patch against fs/ufs/!
>
> There is a fashion lately of people prefixing patch titles along the
> lines of
>
>   scsi: ufs: fix potential NULL pointer dereferencing error in
> ufshcd_probe.
>
> or even
>
>   drivers: scsi: ufs: fix potential NULL pointer dereferencing error in
> ufshcd_probe.
>
> that's nuts, and I regularly turn this into a proper pathname - why
> not?
>
>   drivers/scsi/ufs: fix potential NULL pointer dereferencing error in
> ufshcd_probe.
>
>
> I'll stop now :)
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [SCSI] ufs: fix potential NULL pointer dereferencing error in ufshcd_probe.
  2012-05-22 20:15 ` Andrew Morton
  2012-05-22 23:03   ` Namjae Jeon
@ 2012-05-23  8:52   ` James Bottomley
  1 sibling, 0 replies; 4+ messages in thread
From: James Bottomley @ 2012-05-23  8:52 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Namjae Jeon, santoshsy, vinholikatti, santosh.sy, linux-scsi

On Tue, 2012-05-22 at 13:15 -0700, Andrew Morton wrote:
> On Mon, 21 May 2012 10:35:36 -0400
> Namjae Jeon <linkinjeon@gmail.com> wrote:
> 
> > Subject: [PATCH] [SCSI] ufs: fix potential NULL pointer dereferencing error in ufshcd_probe.
> 
> Nit: conventionally, the text inside [] is to be discarded by the patch
> recipient, so the title of this patch is
> 
> 	ufs: fix potential NULL pointer dereferencing error in ufshcd_probe.
> 
> which makes it look like a patch against fs/ufs/!
> 
> There is a fashion lately of people prefixing patch titles along the
> lines of
> 
>   scsi: ufs: fix potential NULL pointer dereferencing error in ufshcd_probe.
> 
> or even
> 
>   drivers: scsi: ufs: fix potential NULL pointer dereferencing error in ufshcd_probe.
> 
> that's nuts, and I regularly turn this into a proper pathname - why
> not?
> 
>   drivers/scsi/ufs: fix potential NULL pointer dereferencing error in ufshcd_probe.

Because it's a question of who has to mangle the patch title.  If it's
the latter, it's me.  The [SCSI] tree tag I use implies we're in
driver/scsi, so I only add extra bits if we move outside that.

James



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-05-23  8:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-21 14:35 [PATCH] [SCSI] ufs: fix potential NULL pointer dereferencing error in ufshcd_probe Namjae Jeon
2012-05-22 20:15 ` Andrew Morton
2012-05-22 23:03   ` Namjae Jeon
2012-05-23  8:52   ` James Bottomley

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.