xfs: Fix error code in 'xfs_ioc_getbmap()'
commit 132bf6723749f7219c399831eeb286dbbb985429 upstream. In this function, once 'buf' has been allocated, we unconditionally return 0. However, 'error' is set to some error codes in several error handling paths. Before commit232b51948b("xfs: simplify the xfs_getbmap interface") this was not an issue because all error paths were returning directly, but now that some cleanup at the end may be needed, we must propagate the error code. Fixes:232b51948b("xfs: simplify the xfs_getbmap interface") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a585ac0e76
commit
b6095cbd78
@@ -1616,7 +1616,7 @@ xfs_ioc_getbmap(
|
||||
error = 0;
|
||||
out_free_buf:
|
||||
kmem_free(buf);
|
||||
return 0;
|
||||
return error;
|
||||
}
|
||||
|
||||
struct getfsmap_info {
|
||||
|
||||
Reference in New Issue
Block a user