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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
[email protected]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux