Merge branch 'topic/msm8916' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[sfrench/cifs-2.6.git] / fs / xfs / xfs_reflink.c
index ab2270a87196949357ea2e29f921db0762d9d6d7..f45fbf0db9bbea2cfb9578afd76de61b44bc7285 100644 (file)
@@ -170,6 +170,8 @@ xfs_reflink_find_shared(
        error = xfs_alloc_read_agf(mp, tp, agno, 0, &agbp);
        if (error)
                return error;
+       if (!agbp)
+               return -ENOMEM;
 
        cur = xfs_refcountbt_init_cursor(mp, tp, agbp, agno, NULL);
 
@@ -329,7 +331,7 @@ xfs_reflink_convert_cow_extent(
        xfs_filblks_t                   count_fsb,
        struct xfs_defer_ops            *dfops)
 {
-       xfs_fsblock_t                   first_block;
+       xfs_fsblock_t                   first_block = NULLFSBLOCK;
        int                             nimaps = 1;
 
        if (imap->br_state == XFS_EXT_NORM)