linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* passing positive numbers to ERR_PTR()
@ 2012-02-08  9:18 Dan Carpenter
  2012-02-08 15:01 ` [PATCH] Btrfs: avoid positive number with ERR_PTR Jan Schmidt
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-02-08  9:18 UTC (permalink / raw)
  To: Jan Schmidt; +Cc: linux-btrfs

Hi Jan,

Smatch complains when you pass positive numbers to ERR_PTR().  There
is a warning triggered in iref_to_path().

fs/btrfs/backref.c +920 iref_to_path()
   918  
   919          if (ret)
   920                  return ERR_PTR(ret);
                                       ^^^
"ret" can be either a negative error code, zero, or one here.

   921  

I looked at the code, but couldn't tell if it was intentional or not.
It really is pretty unusual to do that, so maybe there should be a
comment or something.

regards,
dan carpenter

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

end of thread, other threads:[~2012-02-08 15:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-08  9:18 passing positive numbers to ERR_PTR() Dan Carpenter
2012-02-08 15:01 ` [PATCH] Btrfs: avoid positive number with ERR_PTR Jan Schmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).