sync: Fix error paths
authorRebecca Schultz Zavin <rebecca@android.com>
Wed, 8 Aug 2012 20:46:22 +0000 (13:46 -0700)
committerVarun Wadekar <vwadekar@nvidia.com>
Mon, 13 Aug 2012 08:43:19 +0000 (13:43 +0530)
commit9b4436ab334a870acf102bad5eb0155c7823a34e
tree8e452dce7ab78212b82426047f76d1d85ae39676
parente274e91ec5cb58174c672674df400626a11a3600
sync: Fix error paths

Check the return value of get_unused_fd to make sure a valid
file descriptor is returned.

Make sure to call put_unused_fd even if an error occurs before
the fd can be used.

Change-Id: I0fe8f78d9e30ecfc4d271c5d875424543dae2d0f
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
drivers/base/sync.c