Re: [PATCH] fix unaligned exception in /drivers/net/wireless/orinoco.c

From: John W. Linville
Date: Fri Feb 02 2007 - 15:36:59 EST


On Thu, Jan 18, 2007 at 09:57:18AM -0000, Hennerich, Michael wrote:
>
> This short patch prevents an unaligned exception to occur. (GCC 4.1)
> tmp is defined as char pointer while it is later accessed as short.
>
> Best regards,
> Michael
>
> Index: linux-2.6.19.2/drivers/net/wireless/orinoco.c
> ===================================================================
> --- linux-2.6.x/drivers/net/wireless/orinoco.c (Revision 2649)
> +++ linux-2.6.x/drivers/net/wireless/orinoco.c (Arbeitskopie)
> @@ -2053,7 +2053,7 @@
> int err;
> struct comp_id nic_id, sta_id;
> unsigned int firmver;
> - char tmp[SYMBOL_MAX_VER_LEN+1];
> + char tmp[SYMBOL_MAX_VER_LEN+1] __attribute__ ((aligned(2)));
>
> /* Get the hardware version */
> err = HERMES_READ_RECORD(hw, USER_BAP, HERMES_RID_NICID, &nic_id);

This patch seems fine, such as it is. But, it seems like it might
also be appropriate to change hermes_read_ltv and/or hermes_read_words
to not take void * parameters? This patch would still be needed,
but it might be more obvious to future coders?

John
--
John W. Linville
linville@xxxxxxxxxxxxx
-
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/