Skip to contentSkip to conversation

ocrdma: missing break in switch statement.

PATCH Dave Jones 1 participant 1 message Jan 29, 2014

Subsystems (2)
lore
Share & tools
lore

Dave Jones

author
#0 lore raw

I've been going through the 'missing break' warnings in coverity, and there's a bunch in infiniband. A lot look intentional, but this one can't be right.
We set a variable, and then immediately overwrite it.

instead of adding break spaghetti, just return the correct value.

drivers/infiniband/hw/ocrdma/ocrdma_hw.c +2 -2
index 1664d648cbfc..b45b7f8d9103 100644
@@ -234,9 +234,9 @@ static int ocrdma_get_mbx_errno(u32 status)
 	case OCRDMA_MBX_STATUS_FAILED:
 		switch (add_status) {
 		case OCRDMA_MBX_ADDI_STATUS_INSUFFICIENT_RESOURCES:
-			err_num = -EAGAIN;
-			break;
+			return -EAGAIN;
 		}
+
 	default:
 		err_num = -EFAULT;
 	}