Bug 47671

Summary: infiniband/hw/nes/nes_verbs.c:3008: possible missing break ?
Product: Drivers Reporter: David Binderman (dcb314)
Component: Infiniband/RDMAAssignee: drivers_infiniband-rdma
Status: RESOLVED CODE_FIX    
Severity: normal CC: alan, florian
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.6-rc6 Subsystem:
Regression: No Bisected commit-id:
Attachments: Fix for the missing break in the switch statement

Description David Binderman 2012-09-18 19:59:09 UTC
I just ran the static analyser cppcheck over the source code of the
linux kernel version 3.6-rc6.

It said

[linux-3.6-rc6/drivers/infiniband/hw/nes/nes_verbs.c:3008]: (warning) Redundant assignment of "next_iwarp_state" in switch

The source code is

                    switch (nesqp->hw_iwarp_state) {
                        case NES_AEQE_IWARP_STATE_CLOSING:
                            next_iwarp_state = NES_CQP_QP_IWARP_STATE_CLOSING;
                        case NES_AEQE_IWARP_STATE_TERMINATE:

That looks like a possible missing break after the first case.
Comment 1 tatyana.e.nikolova 2012-10-02 01:17:45 UTC
Created attachment 81811 [details]
Fix for the missing break in the switch statement
Comment 2 Florian Mickler 2012-10-15 20:47:16 UTC
A patch referencing this bug report has been merged in Linux v3.7-rc1:

commit d5fb476a10a9de56fb518886619ae9a6bf7c7efd
Author: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
Date:   Tue Oct 2 16:38:12 2012 +0000

    RDMA/nes: Add missing break to switch.