lkml.org 
[lkml]   [2019]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] afs: remove redundant assignment to variable ret
Date
Colin King <colin.king@canonical.com> wrote:

> The variable ret is being assigned a value however this is never
> read and later it is being reassigned to a new value. The assignment
> is redundant and hence can be removed.

No.

> if (ret == 0) {
> ret = acl->size;
> if (size > 0) {
> - ret = -ERANGE;
> if (acl->size > size)
> return -ERANGE;
> memcpy(buffer, acl->data, acl->size);

This is the wrong solution. acl and key need releasing, so the return should
be a goto.

David

\
 
 \ /
  Last update: 2019-05-12 08:57    [W:0.054 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site