lkml.org 
[lkml]   [2003]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] megaraid driver fix for 2.5.70
Date
> > Coming back to main issue, declaring complete mailbox would 
> be superfluous
> > since driver uses 16 bytes at most. The following patch
> should fix the panic
> >
> > mbox = (mbox_t *)raw_mbox;
> >
> > - memset(mbox, 0, sizeof(*mbox));
> > + memset(mbox, 0, 16);
> >
> > memset((void *)adapter->mega_buffer, 0, MEGA_BUFFER_SIZE);
> >
>
> This, I think, is a bad idea. It looks intrinsically wrong
> to allocate
> storage and assign a pointer to it of a type that is longer than the
> allocated storage. The initial buffer overrun was due to
> problems with
> this.

IMO then, your original patch should be good.

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

\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.017 / U:0.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site