Search Linux Wireless

Re: [PATCH] iwlwifi: mvm: fix an unaligned access

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

 



Hi,

On Mon, 18 Feb 2019 at 19:40, <wangxuerui@xxxxxxxxx> wrote:
>
> From: Wang Xuerui <wangxuerui@xxxxxxxxx>
>
> Tested with a Wireless AC 7265 on a MIPS box, confirmed to fix the
> unaligned accesses.
>
> Signed-off-by: Wang Xuerui <wangxuerui@xxxxxxxxx>
> ---
>  drivers/net/wireless/intel/iwlwifi/mvm/rx.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
> index 6653a238f32e..a155e816262e 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
> @@ -57,6 +57,7 @@
>   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
>   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>   *****************************************************************************/
> +#include <asm/unaligned.h>
>  #include <linux/etherdevice.h>
>  #include <linux/skbuff.h>
>  #include "iwl-trans.h"
> @@ -355,8 +356,8 @@ void iwl_mvm_rx_rx_mpdu(struct iwl_mvm *mvm, struct napi_struct *napi,
>         rx_res = (struct iwl_rx_mpdu_res_start *)pkt->data;
>         hdr = (struct ieee80211_hdr *)(pkt->data + sizeof(*rx_res));
>         len = le16_to_cpu(rx_res->byte_count);
> -       rx_pkt_status = le32_to_cpup((__le32 *)
> -               (pkt->data + sizeof(*rx_res) + len));
> +       rx_pkt_status = le32_to_cpu(get_unaligned((__le32 *)
> +               (pkt->data + sizeof(*rx_res) + len)));

There's get_unaligned_le32() for that purpose.


Regards
Jonas



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux