Messages in this thread | | | From | Nick Desaulniers <> | Date | Tue, 9 Jul 2019 16:16:37 -0700 | Subject | Re: [PATCH v2] IB/rdmavt: Fix variable shadowing issue in rvt_create_cq |
| |
On Tue, Jul 9, 2019 at 4:06 PM Nathan Chancellor <natechancellor@gmail.com> wrote: > The function scoped err variable is uninitialized when the flow jumps > into the if statement. The if scoped err variable shadows the function > scoped err variable, preventing the err assignments within the if > statement to be reflected at the function level, which will cause > uninitialized use when the goto statements are taken. > > Just remove the if scoped err declaration so that there is only one > copy of the err variable for this function. > > Fixes: 239b0e52d8aa ("IB/hfi1: Move rvt_cq_wc struct into uapi directory") > Link: https://github.com/ClangBuiltLinux/linux/issues/594 > Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> > --- > > v1 -> v2: > > * Updated the wording of the commit message to use proper terms like > scoping and shadowing, thanks to review from Nick (let me know if the > wording isn't up to snuff).
LGTM thanks for following up w/ v2. -- Thanks, ~Nick Desaulniers
| |