diff options
author | Raghavendra Talur <rtalur@redhat.com> | 2013-08-29 17:17:14 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-09-10 01:18:52 -0700 |
commit | 4995efd2280ceb2668145277984c5ea4a0af6e30 (patch) | |
tree | ca4efd9de6bf5acbc96f14ed3a32c34da9f375d3 /api | |
parent | 4e598f4745d733a496c4d252a703d3359189ad2b (diff) |
api: Add null check for active_subvol in glfs_close.
Problem:
In glfs_close, NULL value returned by glfs_active_subvol was not
being checked and was causing a crash.
Change-Id: I6eefa60e7b07dee251b98932b1d08a5c2981d3d7
BUG: 1002511
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/5876
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'api')
-rw-r--r-- | api/src/glfs-fops.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index 3aa8ab834..4e1a7ef53 100644 --- a/api/src/glfs-fops.c +++ b/api/src/glfs-fops.c @@ -159,6 +159,11 @@ glfs_close (struct glfs_fd *glfd) __glfs_entry_fd (glfd); subvol = glfs_active_subvol (glfd->fs); + if (!subvol) { + ret = -1; + errno = EIO; + goto out; + } fd = glfs_resolve_fd (glfd->fs, subvol, glfd); if (!fd) { |