>> A local variable was set to an error code in two cases before a concrete
>> error situation was detected. Thus move the corresponding assignment into
>> an if branch to indicate a software failure there.
>>
>> This issue was detected by using the Coccinelle software.
>>
>> Signed-off-by: Markus Elfring <[email protected]>
> Acked-by: Jan-Benedict Glaw <[email protected]>
Thanks for your positive feedback.
Unfortunately, I have got the impression that this update step is inappropriate
so far because the suggested change for the handling of the error code “-EFAULT”
can be incomplete (or a bit too much).
Which implementation would you prefer?
A) Keep the variable assignment before the check for the call of
the function “copy_from_user”
B) Add an assignment in another condition branch at the end.
res = (int) ret1;
+ } else {
+ res = -EFAULT;
}
Regards,
Markus