public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: "Timofei V. Bondarenko" <timm@ipi.ac.ru>
Cc: linux-mtd@lists.infradead.org
Subject: Re: misaligned memory access in cmdlinepart.c
Date: Tue, 7 Jun 2005 15:02:16 +0200	[thread overview]
Message-ID: <20050607130216.GA4173@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <42A55B15.8000506@ipi.ac.ru>

On Tue, 7 June 2005 12:30:13 +0400, Timofei V. Bondarenko wrote:
> 
> Ok, sorry for noise.
> Is it good enough?

Still broken.  You have some whitespace noise in it.

I could easily fix it up, but I feel like a bastard and prefer to
share the pain.  If your mail reader is screwing it up, you can send
the patch as an attachment.  Inline would be preferred, though.

> diff -u -p -r1.17 cmdlinepart.c
> --- mtd/drivers/mtd/cmdlinepart.c	26 Nov 2004 11:18:47 -0000	1.17
> +++ mtd/drivers/mtd/cmdlinepart.c	7 Jun 2005 08:02:00 -0000
> @@ -239,7 +239,8 @@ static int mtdpart_setup_real(char *s)
>  				&num_parts,	/* out: number of parts */
>  				0,		/* first partition */
>  				(unsigned char**)&this_mtd, /* out: extra 
>  				mem */
> -				mtd_id_len + 1 + sizeof(*this_mtd));
> +				mtd_id_len + 1 + sizeof(*this_mtd) +
> +                                sizeof(void*)-1 /*alignment*/);
>  		if(!parts)
>  		{
>  			/*
> @@ -252,7 +253,10 @@ static int mtdpart_setup_real(char *s)
>  			 return 0;
>  		 }
> 
> -		/* enter results */	
> +		/* align this_mtd */
> +                this_mtd = (struct cmdline_mtd_partition *)
> +                    ALIGN((unsigned long)this_mtd, sizeof(void*));
> +		/* enter results */
>  		this_mtd->parts = parts;
>  		this_mtd->num_parts = num_parts;
>  		this_mtd->mtd_id = (char*)(this_mtd + 1);
> 
> 

Jörn

-- 
I've never met a human being who would want to read 17,000 pages of
documentation, and if there was, I'd kill him to get him out of the
gene pool.
-- Joseph Costello

      parent reply	other threads:[~2005-06-07 13:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-27 11:03 misaligned memory access in cmdlinepart.c Timofei V. Bondarenko
2005-06-06 13:26 ` Timofei V. Bondarenko
2005-06-06 13:34 ` Jörn Engel
     [not found]   ` <42A4572C.8020107@ipi.ac.ru>
     [not found]     ` <20050606141453.GF31739@wohnheim.fh-wedel.de>
2005-06-06 15:28       ` Timofei V. Bondarenko
     [not found]       ` <42A460BB.50800@ipi.ac.ru>
     [not found]         ` <20050606162648.GJ31739@wohnheim.fh-wedel.de>
2005-06-06 16:49           ` Timofei V. Bondarenko
2005-06-06 17:44             ` Jörn Engel
2005-06-07  8:30               ` Timofei V. Bondarenko
2005-06-07  9:01                 ` Vitaly Wool
2005-06-07  9:26                   ` Timofei V. Bondarenko
2005-06-07 11:34                   ` Timofei V. Bondarenko
2005-06-07 13:02                 ` Jörn Engel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050607130216.GA4173@wohnheim.fh-wedel.de \
    --to=joern@wohnheim.fh-wedel.de \
    --cc=linux-mtd@lists.infradead.org \
    --cc=timm@ipi.ac.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox