assert macro to check null

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Sat Aug 10 01:35:48 EDT 2013


On Sat, 10 Aug 2013 09:58:10 +0530, Saket Sinha said:

> get_cred(new); where null is struct cred *new.
>
> I think this new might be NULL.
>
> Now I plan to add an assert in our macro that deals with creds, like for
> asserting passed object isn't NULL.
>
> Any suggestions as to how I can do that?

	WARN_ON(!new);

is probably your best bet.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130810/6ddec3c7/attachment.bin 


More information about the Kernelnewbies mailing list