Re: [PATCH 1/3] crypto: add enum

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

 



> >>  
> >> +struct digest *digest_alloc_by_algo(enum hash_algo hash_algo)
> >> +{
> >> +	struct digest *d;
> >> +	struct digest_algo *algo;
> >> +
> >> +	algo = digest_algo_get_by_algo(hash_algo);
> >> +	if (!algo)
> >> +		return NULL;
> >> +
> >> +	d = xzalloc(sizeof(*d));
> >> +	d->algo = algo;
> >> +	d->ctx = xzalloc(algo->ctx_length);
> > 
> > Neither allocations are checked for failure.
> 
> If xzalloc fails barebox will go into OOM and throw a backtrace.
Makes sense. I thought about this, but failed to go back
and check this myself.

	Sam

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux