Re: [patch] bus: sunxi-rsb: unlock on error in sunxi_rsb_read()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 04, 2015 at 10:22:35PM +0100, walter harms wrote:
> NTL one comment, if you looked it as success handling it may be uncommon
> but i you see it as "proctector" it is more obvious like
> if (f) free(f);

You shouldn't normally have those kinds of if statements because you
should handle the case of if "f" is NULL immediately.  It shouldn't be a
question of "I'm half way through the function and I don't know what has
been allocated and what is free."

If you have an if condition like that it probably means you are doing
One Err style error handling and we all know my feelings about that.  ;)

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux