Commit d2a5e3c6 authored by Markus Elfring's avatar Markus Elfring Committed by Dave Chinner

xfs: remove unnecessary null checks

The functions xfs_blkdev_put() and xfs_qm_dqrele() test whether
their argument is NULL and then return immediately.  Thus the test
around the call is not needed.

This issue was detected by using the Coccinelle software.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent cac7f242
...@@ -1749,23 +1749,21 @@ xfs_qm_vop_dqalloc( ...@@ -1749,23 +1749,21 @@ xfs_qm_vop_dqalloc(
xfs_iunlock(ip, lockflags); xfs_iunlock(ip, lockflags);
if (O_udqpp) if (O_udqpp)
*O_udqpp = uq; *O_udqpp = uq;
else if (uq) else
xfs_qm_dqrele(uq); xfs_qm_dqrele(uq);
if (O_gdqpp) if (O_gdqpp)
*O_gdqpp = gq; *O_gdqpp = gq;
else if (gq) else
xfs_qm_dqrele(gq); xfs_qm_dqrele(gq);
if (O_pdqpp) if (O_pdqpp)
*O_pdqpp = pq; *O_pdqpp = pq;
else if (pq) else
xfs_qm_dqrele(pq); xfs_qm_dqrele(pq);
return 0; return 0;
error_rele: error_rele:
if (gq) xfs_qm_dqrele(gq);
xfs_qm_dqrele(gq); xfs_qm_dqrele(uq);
if (uq)
xfs_qm_dqrele(uq);
return error; return error;
} }
......
...@@ -796,8 +796,7 @@ xfs_open_devices( ...@@ -796,8 +796,7 @@ xfs_open_devices(
out_free_ddev_targ: out_free_ddev_targ:
xfs_free_buftarg(mp, mp->m_ddev_targp); xfs_free_buftarg(mp, mp->m_ddev_targp);
out_close_rtdev: out_close_rtdev:
if (rtdev) xfs_blkdev_put(rtdev);
xfs_blkdev_put(rtdev);
out_close_logdev: out_close_logdev:
if (logdev && logdev != ddev) if (logdev && logdev != ddev)
xfs_blkdev_put(logdev); xfs_blkdev_put(logdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment