mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-07 11:10:44 +00:00
scoutfs: check for NULL lock in scoutfs_unlock
This reduces the amount of duplicate code in callers and makes error handling easier. The alternative is to sprinkle the code with 'if (lock)' lines at the end of our functions. Signed-off-by: Mark Fasheh <mfasheh@versity.com>
This commit is contained in:
@@ -513,6 +513,9 @@ void scoutfs_unlock(struct super_block *sb, struct scoutfs_lock *lock)
|
||||
{
|
||||
DECLARE_LOCK_INFO(sb, linfo);
|
||||
|
||||
if (!lock)
|
||||
return;
|
||||
|
||||
trace_scoutfs_unlock(sb, lock);
|
||||
|
||||
spin_lock(&linfo->lock);
|
||||
|
||||
Reference in New Issue
Block a user