Bug 47671 - infiniband/hw/nes/nes_verbs.c:3008: possible missing break ?
Summary: infiniband/hw/nes/nes_verbs.c:3008: possible missing break ?
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Infiniband/RDMA (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_infiniband-rdma
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-18 19:59 UTC by David Binderman
Modified: 2012-11-08 14:20 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.6-rc6
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Fix for the missing break in the switch statement (881 bytes, application/octet-stream)
2012-10-02 01:17 UTC, tatyana.e.nikolova
Details

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.

Note You need to log in before you can comment on or make changes to this bug.