lkml.org 
[lkml]   [2015]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 09/12] staging: lustre: obdclass: Use !x to check for kzalloc failure
> > @@ -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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2015-06-21 12:41    [W:0.055 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site