public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michel Marti <michel.marti@objectxp.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] 2.6.4: Fix NULL pointer dereference in blkmtd.c
Date: Thu, 11 Mar 2004 09:30:14 +0100	[thread overview]
Message-ID: <40502396.3030402@objectxp.com> (raw)

Hello all,

The blkmtd driver oopses in add_device(). The following trivial patch fixes
this.

Cheers,

- Michel


diff -urN linux-2.6.4/drivers/mtd/devices/blkmtd.c linux-2.6.4-mma/drivers/mtd/devices/blkmtd.c
--- linux-2.6.4/drivers/mtd/devices/blkmtd.c	2004-02-18 04:57:13.000000000 +0100
+++ linux-2.6.4-mma/drivers/mtd/devices/blkmtd.c	2004-03-11 09:02:45.000000000 +0100
@@ -664,12 +664,12 @@
  	}

  	memset(dev, 0, sizeof(struct blkmtd_dev));
+	dev->blkdev = bdev;
  	atomic_set(&(dev->blkdev->bd_inode->i_mapping->truncate_count), 0);
  	if(!readonly) {
  		init_MUTEX(&dev->wrbuf_mutex);
  	}

-	dev->blkdev = bdev;
  	dev->mtd_info.size = dev->blkdev->bd_inode->i_size & PAGE_MASK;

  	/* Setup the MTD structure */


                 reply	other threads:[~2004-03-11  8:30 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=40502396.3030402@objectxp.com \
    --to=michel.marti@objectxp.com \
    --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