mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: torvalds@osdl.org
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] fix adm9240 oops
Date: Thu, 25 Aug 2005 14:56:29 -0600	[thread overview]
Message-ID: <20050825205629.22372.qmail@lwn.net> (raw)

The adm9240 driver, in adm9240_detect(), allocates a structure.  The
error path attempts to kfree() a subfield of that structure, resulting
in an oops (or slab corruption) if the hardware is not present.  This
one seems worth fixing for 2.6.13.

jon

Signed-off-by: Jonathan Corbet <corbet@lwn.net>

--- 2.6.13-rc7/drivers/hwmon/adm9240.c.orig	2005-08-25 14:30:04.000000000 -0600
+++ 2.6.13-rc7/drivers/hwmon/adm9240.c	2005-08-25 14:30:26.000000000 -0600
@@ -616,7 +616,7 @@ static int adm9240_detect(struct i2c_ada
 
 	return 0;
 exit_free:
-	kfree(new_client);
+	kfree(data);
 exit:
 	return err;
 }

             reply	other threads:[~2005-08-25 20:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-25 20:56 Jonathan Corbet [this message]
2005-08-25 21:49 ` [PATCH] drivers/hwmon/*: kfree() correct pointers Alexey Dobriyan
2005-08-25 22:02   ` Jean Delvare
2005-08-25 23:53     ` Jonathan Corbet
2005-08-26  7:32       ` 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=20050825205629.22372.qmail@lwn.net \
    --to=corbet@lwn.net \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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

Powered by JetHome