On Tue, Jul 08, 2014 at 01:23:46AM +0400, Antony Pavlov wrote: > On Mon, 7 Jul 2014 20:22:10 +0200 > Jean-Christophe PLAGNIOL-VILLARD <plagnioj@xxxxxxxxxxxx> wrote: > > > > +static struct pci_bus *pci_alloc_bus(void) > > > +{ > > > + struct pci_bus *b; > > > + > > > + b = kzalloc(sizeof(*b), GFP_KERNEL); > > > > if (!b) > > return b; > > kzalloc() eventually calls xmalloc(). > xmalloc() calls panic() if malloc fails, so there is no need to check b at all. Then let's use xzalloc directly here. I think only the x functions should panic on failure. kzalloc should be implemented with malloc or calloc. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox