Skip to content

Commit 4e86281

Browse files
mdrustadJeff Kirsher
authored andcommitted
ixgbe: Fix ixgbe_write_mbx error result
If ixgbe_write_mbx is called and no mbx->ops.write method exists, no error code is returned. The corresponding read function explicitly returns an error in such a case as do other functions, so this appears to be a minor bug. Fix it for consistency, and generate return values directly to make things clearer. Signed-off-by: Mark Rustad <[email protected]> Tested-by: Phil Schmitt <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent acb1ce2 commit 4e86281

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************************
22
33
Intel 10 Gigabit PCI Express Linux driver
4-
Copyright(c) 1999 - 2013 Intel Corporation.
4+
Copyright(c) 1999 - 2014 Intel Corporation.
55
66
This program is free software; you can redistribute it and/or modify it
77
under the terms and conditions of the GNU General Public License,
@@ -67,15 +67,14 @@ s32 ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
6767
s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
6868
{
6969
struct ixgbe_mbx_info *mbx = &hw->mbx;
70-
s32 ret_val = 0;
7170

7271
if (size > mbx->size)
73-
ret_val = IXGBE_ERR_MBX;
72+
return IXGBE_ERR_MBX;
7473

75-
else if (mbx->ops.write)
76-
ret_val = mbx->ops.write(hw, msg, size, mbx_id);
74+
if (!mbx->ops.write)
75+
return IXGBE_ERR_MBX;
7776

78-
return ret_val;
77+
return mbx->ops.write(hw, msg, size, mbx_id);
7978
}
8079

8180
/**

0 commit comments

Comments
 (0)