public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* fs/buffer.c:nobh_write_end(): NULL dereference
@ 2007-10-19 13:43 Adrian Bunk
  0 siblings, 0 replies; only message in thread
From: Adrian Bunk @ 2007-10-19 13:43 UTC (permalink / raw)
  To: Nick Piggin; +Cc: linux-kernel

Commit 03158cd7eb3374843de68421142ca5900df845d9 introcduced the 
following NULL dereference:

<--  snip  -->

...
int nobh_write_end(struct file *file, struct address_space *mapping,
                        loff_t pos, unsigned len, unsigned copied,
                        struct page *page, void *fsdata)
{
        struct inode *inode = page->mapping->host;
        struct buffer_head *head = NULL;
        struct buffer_head *bh;

        if (!PageMappedToDisk(page)) {
                if (unlikely(copied < len) && !page_has_buffers(page))
                        attach_nobh_buffers(page, head);
...                                               ^^^^

<--  snip  -->

Spotted by the Coverity checker.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-10-19 13:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-19 13:43 fs/buffer.c:nobh_write_end(): NULL dereference Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox