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


Groups > linux.kernel > #1584240 > unrolled thread

[PATCH] sd: Fix error handling

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2017-02-19 20:40 +0100
Last post2017-02-19 20:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] sd: Fix error handling Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-02-19 20:40 +0100

#1584240 — [PATCH] sd: Fix error handling

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2017-02-19 20:40 +0100
Subject[PATCH] sd: Fix error handling
Message-ID<tcFuV-2Wo-3@gated-at.bofh.it>
Reorder 'out_free' and 'out_free_devt' error handling labels in order to
match the way resources have been allocated.


Fixes: 0dba1314d4f8 ("scsi, block: fix duplicate bdi name registration crashes")

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/scsi/sd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index cb6e68dd6df0..99e12061a6fb 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3213,10 +3213,10 @@ static int sd_probe(struct device *dev)
 	sd_devt = NULL;
  out_put:
 	put_disk(gd);
- out_free:
-	kfree(sdkp);
  out_free_devt:
 	kfree(sd_devt);
+ out_free:
+	kfree(sdkp);
  out:
 	scsi_autopm_put_device(sdp);
 	return error;
-- 
2.9.3

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web