Skip to content

Commit

Permalink
staging: sync: fix return value check in sync_fence_alloc()
Browse files Browse the repository at this point in the history
In case of error, the function anon_inode_getfile() returns
ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Wei Yongjun authored and Greg Kroah-Hartman committed Mar 11, 2013
1 parent 70c1e91 commit 5969136
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/android/sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ static struct sync_fence *sync_fence_alloc(const char *name)

fence->file = anon_inode_getfile("sync_fence", &sync_fence_fops,
fence, 0);
if (fence->file == NULL)
if (IS_ERR(fence->file))
goto err;

kref_init(&fence->kref);
Expand Down

0 comments on commit 5969136

Please sign in to comment.