All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] xfs: connect refcount adjust functions to upper layers
@ 2016-12-15 12:23 Dan Carpenter
  2016-12-16  1:46 ` Darrick J. Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-12-15 12:23 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs

Hello Darrick J. Wong,

The patch 33ba61292084: "xfs: connect refcount adjust functions to
upper layers" from Oct 3, 2016, leads to the following static checker
warning:

	fs/xfs/xfs_refcount_item.c:535 xfs_cui_recover()
	warn: passing freed memory 'rcur'

fs/xfs/xfs_refcount_item.c
   523                  }
   524          }
   525  
   526          xfs_refcount_finish_one_cleanup(tp, rcur, error);
                                                    ^^^^
Freed here.

   527          error = xfs_defer_finish(&tp, &dfops, NULL);
   528          if (error)
   529                  goto abort_error;
   530          set_bit(XFS_CUI_RECOVERED, &cuip->cui_flags);
   531          error = xfs_trans_commit(tp);
   532          return error;
   533  
   534  abort_error:
   535          xfs_refcount_finish_one_cleanup(tp, rcur, error);
                                                    ^^^^
Again here...

   536          xfs_defer_cancel(&dfops);
   537          xfs_trans_cancel(tp);
   538          return error;
   539  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] xfs: connect refcount adjust functions to upper layers
  2016-12-15 12:23 [bug report] xfs: connect refcount adjust functions to upper layers Dan Carpenter
@ 2016-12-16  1:46 ` Darrick J. Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2016-12-16  1:46 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-xfs

On Thu, Dec 15, 2016 at 03:23:57PM +0300, Dan Carpenter wrote:
> Hello Darrick J. Wong,
> 
> The patch 33ba61292084: "xfs: connect refcount adjust functions to
> upper layers" from Oct 3, 2016, leads to the following static checker
> warning:
> 
> 	fs/xfs/xfs_refcount_item.c:535 xfs_cui_recover()
> 	warn: passing freed memory 'rcur'
> 
> fs/xfs/xfs_refcount_item.c
>    523                  }
>    524          }
>    525  
>    526          xfs_refcount_finish_one_cleanup(tp, rcur, error);
>                                                     ^^^^
> Freed here.
> 
>    527          error = xfs_defer_finish(&tp, &dfops, NULL);
>    528          if (error)
>    529                  goto abort_error;
>    530          set_bit(XFS_CUI_RECOVERED, &cuip->cui_flags);
>    531          error = xfs_trans_commit(tp);
>    532          return error;
>    533  
>    534  abort_error:
>    535          xfs_refcount_finish_one_cleanup(tp, rcur, error);
>                                                     ^^^^
> Again here...

Yep, definitely a bug.  I'll make a fix.

--D

> 
>    536          xfs_defer_cancel(&dfops);
>    537          xfs_trans_cancel(tp);
>    538          return error;
>    539  }
> 
> regards,
> dan carpenter
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-16  1:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-15 12:23 [bug report] xfs: connect refcount adjust functions to upper layers Dan Carpenter
2016-12-16  1:46 ` Darrick J. Wong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.