sw_sync: Fix error paths
authorRebecca Schultz Zavin <rebecca@android.com>
Wed, 8 Aug 2012 20:44:11 +0000 (13:44 -0700)
committerVarun Wadekar <vwadekar@nvidia.com>
Mon, 13 Aug 2012 08:43:19 +0000 (13:43 +0530)
commit559be66522421d65e323a2fae1016d968c1b9d12
tree6f40fd605d73bfec1a0ecf30df7a6d1b7df40b98
parent9b4436ab334a870acf102bad5eb0155c7823a34e
sw_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: Ibbf55caebc2f8ee6a03f298eb0ae0189c7d10b5c
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
drivers/base/sw_sync.c