lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1211330472.5915.228.camel@brick>
Date:	Tue, 20 May 2008 17:41:12 -0700
From:	Harvey Harrison <harvey.harrison@...il.com>
To:	Al Viro <viro@....linux.org.uk>
Cc:	mchehab@...radead.org, linux-kernel@...r.kernel.org,
	torvalds@...ux-foundation.org
Subject: Re: [PATCH] or51132.c: unaligned

On Wed, 2008-05-21 at 01:33 +0100, Al Viro wrote:
> Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
> ---
>  drivers/media/dvb/frontends/or51132.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/dvb/frontends/or51132.c b/drivers/media/dvb/frontends/or51132.c
> index c7b5785..5ed3254 100644
> --- a/drivers/media/dvb/frontends/or51132.c
> +++ b/drivers/media/dvb/frontends/or51132.c
> @@ -126,7 +126,7 @@ static int or51132_readreg(struct or51132_state *state, u8 reg)
>  		       reg, err);
>  		return -EREMOTEIO;
>  	}
> -	return le16_to_cpup((u16*)buf);
> +	return buf[0] | (buf[1] << 8);

return get_unaligned_le16(buf);

>  }
>  
>  static int or51132_load_firmware (struct dvb_frontend* fe, const struct firmware *fw)
> @@ -140,9 +140,9 @@ static int or51132_load_firmware (struct dvb_frontend* fe, const struct firmware
>  	dprintk("Firmware is %Zd bytes\n",fw->size);
>  
>  	/* Get size of firmware A and B */
> -	firmwareAsize = le32_to_cpu(*((u32*)fw->data));
> +	firmwareAsize = le32_to_cpu(*((__le32*)fw->data));

firmwareAsize = le32_to_cpup((__le32 *)fw->data);

>  	dprintk("FirmwareA is %i bytes\n",firmwareAsize);
> -	firmwareBsize = le32_to_cpu(*((u32*)(fw->data+4)));
> +	firmwareBsize = le32_to_cpu(*((__le32*)(fw->data+4)));

firmwareBsize = le32_to_cpup((__le32 *)(fw->data + 4));

Cheers,

Harvey

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ