Re: [PATCH 09/12] staging: lustre: obdclass: Use !x to check for kzalloc failure

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

 



> > @@ -885,7 +885,7 @@ static int lmd_parse_mgssec(struct lustr
> >  		length = tail - ptr;
> >  
> >  	lmd->lmd_mgssec = kzalloc(length + 1, GFP_NOFS);
> > -	if (lmd->lmd_mgssec == NULL)
> > +	if (!lmd->lmd_mgssec)
> >  		return -ENOMEM;
> >  
> >  	memcpy(lmd->lmd_mgssec, ptr, length);
> looks like memdup()

kmemdup has the same length for both calls.  There is kstrndup, but it
recalculates the length, which looks unnecessary here.

julia
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux