public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jim Cromie <jim.cromie@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux kernel <linux-kernel@vger.kernel.org>
Subject: [ patch -mm1 03/11 ] gpio-patchset-fixups:  scx200 init undo malloc
Date: Thu, 22 Jun 2006 12:50:45 -0600	[thread overview]
Message-ID: <449AE685.3090305@gmail.com> (raw)


If platform_device_add() fails,  the add doesnt need to be undone.
What is needed it to undo the previous malloc.

Signed-off-by:   Jim Cromie <jim.cromie@gmail.com>

diff -ruNp -X dontdiff -X exclude-diffs aa-2/drivers/char/scx200_gpio.c aa-3/drivers/char/scx200_gpio.c
--- aa-2/drivers/char/scx200_gpio.c	2006-06-22 09:43:16.000000000 -0600
+++ aa-3/drivers/char/scx200_gpio.c	2006-06-22 09:30:20.000000000 -0600
@@ -91,7 +91,7 @@ static int __init scx200_gpio_init(void)
 
 	rc = platform_device_add(pdev);
 	if (rc)
-		goto undo_platform_device_add;
+		goto undo_malloc;
 
 	/* nsc_gpio uses dev_dbg(), so needs this */
 	scx200_access.dev = &pdev->dev;
@@ -127,7 +127,8 @@ undo_chrdev_region:
 	unregister_chrdev_region(dev, num_pins);
 undo_platform_device_add:
 	platform_device_put(pdev);
-	kfree(pdev);		/* undo platform_device_alloc */
+undo_malloc:
+	kfree(pdev);
 	return rc;
 }
 



                 reply	other threads:[~2006-06-22 18:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=449AE685.3090305@gmail.com \
    --to=jim.cromie@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox