[Ocfs2-devel] [patch] Fix: 'return -ENOMEM' instead of 'return ENOMEM'

Mike Christie michaelc at cs.wisc.edu
Thu Nov 12 07:10:53 PST 2009


roel kluin wrote:
>> * Andrew Morton <akpm at linux-foundation.org> wrote:
> 
>>> Andy, can we have a checkpatch rule please?
>> Note, that will upset creative uses of error codes i guess, such as
>> fs/xfs/.
>>
>> But yeah, +1 from me too.
>>
>> Ob'post'mortem - looked for similar patterns in the kernel and there's
>> quite a few bugs there:
>>
>>  include/net/inet_hashtables.h:                  return ENOMEM;         # bug
>>  drivers/scsi/aic7xxx/aic7xxx_osm.c:             return ENOMEM;         # works but weird
>>  drivers/scsi/cxgb3i/cxgb3i_offload.c:           return ENOMEM;         # works but weird

I think cxgb3i is actually in the buggy category. cxgb3i_c3cn_send_pdus 
can propagate the positive EXYZ error value to other functions which 
assume that errors are negative.

Karen, I made the attached patch over James's scsi-rc-fixes tree while 
reviewing the code. Could you test, finish up and send upstream?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cxgb3i-use-negative-errno.patch
Type: text/x-patch
Size: 2523 bytes
Desc: not available
Url : http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20091112/09f1764b/attachment.bin 


More information about the Ocfs2-devel mailing list