Re: [PATCH 4/5] ixgbe: Fix incorrect declaration of ixgbevf_mbx_ops

From: Jeff Kirsher
Date: Wed Jun 08 2011 - 15:05:05 EST


On Tue, Jun 7, 2011 at 15:56, Rose, Gregory V <gregory.v.rose@xxxxxxxxx> wrote:
>> -----Original Message-----
>> From: Andi Kleen [mailto:andi@xxxxxxxxxxxxxx]
>> Sent: Tuesday, June 07, 2011 3:27 PM
>> To: linux-kernel@xxxxxxxxxxxxxxx
>> Cc: Andi Kleen; Kirsher, Jeffrey T; Brandeburg, Jesse; Rose, Gregory V
>> Subject: [PATCH 4/5] ixgbe: Fix incorrect declaration of ixgbevf_mbx_ops
>>
>> From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>>
>> The header extern type of ixgbevf_mbx_ops disagreed with
>> the actual declaration. Fix this here.
>>
>> This is rather scary. I haven't tested it. Did this
>> ever work?
>>
>> Cc: jeffrey.t.kirsher@xxxxxxxxx
>> Cc: jesse.brandeburg@xxxxxxxxx
>> Cc: gregory.v.rose@xxxxxxxxx
>> Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>> ---
>> Âdrivers/net/ixgbevf/ixgbevf.h | Â Â2 +-
>> Â1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/net/ixgbevf/ixgbevf.h b/drivers/net/ixgbevf/ixgbevf.h
>> index b703f60..a2bbbb3 100644
>> --- a/drivers/net/ixgbevf/ixgbevf.h
>> +++ b/drivers/net/ixgbevf/ixgbevf.h
>> @@ -279,7 +279,7 @@ enum ixgbevf_boards {
>>
>> Âextern struct ixgbevf_info ixgbevf_82599_vf_info;
>> Âextern struct ixgbevf_info ixgbevf_X540_vf_info;
>> -extern struct ixgbe_mac_operations ixgbevf_mbx_ops;
>> +extern struct ixgbe_mbx_operations ixgbevf_mbx_ops;
>>
>> Â/* needed by ethtool.c */
>> Âextern char ixgbevf_driver_name[];
>> --
>> 1.7.4.4
>
> [Greg Rose]
> Huh.
>
> Well, mbx ops is a table of 8 pointers and mac ops is a table of 11 pointers, so the copy would have over written 3 * pointer-size words of some other memory. ÂBut the 8 ops copied would have been correct so to the extent that we called them they worked.
>
> Now that I look at it you missed a another spot where the copy is done that uses the ixgbe_mac_operations instead of the ixgbe_mbx_operations.
>
> I'll fix that up.
>
> Nice catch!
>
> - Greg
> --

I have an updated patch by Greg in my queue, which I will be
submitting through David Miller's networking tree. Thanks Andi and
Greg!

--
Cheers,
Jeff
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/