diff options
author | Peng Tao <bergwolf@gmail.com> | 2011-09-22 21:50:16 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-10-18 12:08:14 -0400 |
commit | e6d05a757c314ad88d0649d3835a8a1daa964236 (patch) | |
tree | f900bf7912f5eb2546769f19fdfacccbc36e6b59 /fs/nfs/blocklayout | |
parent | 9b7eecdcfeb943f130d86bbc249fde4994b6fe30 (diff) |
pnfsblock: fix NULL pointer dereference
bl_add_page_to_bio returns error pointer. bio should be reset to
NULL in failure cases as the out path always calls bl_submit_bio.
Signed-off-by: Peng Tao <peng_tao@emc.com>
Signed-off-by: Jim Rees <rees@umich.edu>
Cc: stable@kernel.org [3.0]
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/blocklayout')
-rw-r--r-- | fs/nfs/blocklayout/blocklayout.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index 2167ba2afdbb..4ddbfbf1c3ad 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c | |||
@@ -292,6 +292,7 @@ bl_read_pagelist(struct nfs_read_data *rdata) | |||
292 | bl_end_io_read, par); | 292 | bl_end_io_read, par); |
293 | if (IS_ERR(bio)) { | 293 | if (IS_ERR(bio)) { |
294 | rdata->pnfs_error = PTR_ERR(bio); | 294 | rdata->pnfs_error = PTR_ERR(bio); |
295 | bio = NULL; | ||
295 | goto out; | 296 | goto out; |
296 | } | 297 | } |
297 | } | 298 | } |
@@ -581,6 +582,7 @@ fill_invalid_ext: | |||
581 | bl_end_io_write_zero, par); | 582 | bl_end_io_write_zero, par); |
582 | if (IS_ERR(bio)) { | 583 | if (IS_ERR(bio)) { |
583 | wdata->pnfs_error = PTR_ERR(bio); | 584 | wdata->pnfs_error = PTR_ERR(bio); |
585 | bio = NULL; | ||
584 | goto out; | 586 | goto out; |
585 | } | 587 | } |
586 | /* FIXME: This should be done in bi_end_io */ | 588 | /* FIXME: This should be done in bi_end_io */ |
@@ -629,6 +631,7 @@ next_page: | |||
629 | bl_end_io_write, par); | 631 | bl_end_io_write, par); |
630 | if (IS_ERR(bio)) { | 632 | if (IS_ERR(bio)) { |
631 | wdata->pnfs_error = PTR_ERR(bio); | 633 | wdata->pnfs_error = PTR_ERR(bio); |
634 | bio = NULL; | ||
632 | goto out; | 635 | goto out; |
633 | } | 636 | } |
634 | isect += PAGE_CACHE_SECTORS; | 637 | isect += PAGE_CACHE_SECTORS; |