kernel: fixing a potential deadlock in block2mtd for kernel 3.6/3.8/3.9

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>

SVN-Revision: 37842
This commit is contained in:
Felix Fietkau 2013-08-26 17:47:14 +00:00
parent f91d09cabb
commit c75416292a
3 changed files with 6 additions and 3 deletions

View file

@ -53,8 +53,9 @@
page = page_read(dev->blkdev->bd_inode->i_mapping, index); page = page_read(dev->blkdev->bd_inode->i_mapping, index);
- if (IS_ERR(page)) - if (IS_ERR(page))
- return PTR_ERR(page);
+ if (IS_ERR(page)) { + if (IS_ERR(page)) {
return PTR_ERR(page); + err = PTR_ERR(page);
+ goto done; + goto done;
+ } + }

View file

@ -53,8 +53,9 @@
page = page_read(dev->blkdev->bd_inode->i_mapping, index); page = page_read(dev->blkdev->bd_inode->i_mapping, index);
- if (IS_ERR(page)) - if (IS_ERR(page))
- return PTR_ERR(page);
+ if (IS_ERR(page)) { + if (IS_ERR(page)) {
return PTR_ERR(page); + err = PTR_ERR(page);
+ goto done; + goto done;
+ } + }

View file

@ -53,8 +53,9 @@
page = page_read(dev->blkdev->bd_inode->i_mapping, index); page = page_read(dev->blkdev->bd_inode->i_mapping, index);
- if (IS_ERR(page)) - if (IS_ERR(page))
- return PTR_ERR(page);
+ if (IS_ERR(page)) { + if (IS_ERR(page)) {
return PTR_ERR(page); + err = PTR_ERR(page);
+ goto done; + goto done;
+ } + }