driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Jitendra <jkhasdev@gmail.com>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8192e: fix array of flexible structures
Date: Wed, 28 Apr 2021 08:01:21 +0200	[thread overview]
Message-ID: <YIj6MUO5+EDBzOwl@kroah.com> (raw)
In-Reply-To: <20210427185844.GA1030@gmail.com>

On Wed, Apr 28, 2021 at 12:28:44AM +0530, Jitendra wrote:
> On Tue, Apr 27, 2021 at 08:10:20PM +0200, Greg KH wrote:
> > On Tue, Apr 27, 2021 at 11:19:45PM +0530, Jitendra Khasdev wrote:
> > > This patch fixes sparse warning "array of flexible structures"
> > > for rtllib.h.
> > > 
> > > eg. drivers/staging/rtl8192e/rtllib.h:832:48: warning: array of
> > > flexible structures
> > > 
> > > Signed-off-by: Jitendra Khasdev <jkhasdev@gmail.com>
> > > ---
> > >  drivers/staging/rtl8192e/rtllib.h | 10 +++++-----
> > >  1 file changed, 5 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
> > > index 4cabaf2..c7cb318 100644
> > > --- a/drivers/staging/rtl8192e/rtllib.h
> > > +++ b/drivers/staging/rtl8192e/rtllib.h
> > > @@ -802,7 +802,7 @@ struct rtllib_authentication {
> > >  	__le16 transaction;
> > >  	__le16 status;
> > >  	/*challenge*/
> > > -	struct rtllib_info_element info_element[];
> > > +	struct rtllib_info_element *info_element;
> > 
> > You just changed the definition of this structure, and the other
> > structures here.  Are you sure this is working properly?
> > 
> 
> I have compiled the driver and install it on my vm, but I don't this specific
> hardware, so couldn't test it.
> 
> I fixed in context of sparse.

Please verify that this change is correct by looking at how the
structures are being created (i.e. is this being treated as a flexible
array or a pointer?)

I think we have been through this before and that sparse is not right,
but I can't remember...

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2021-04-28  6:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27 17:49 [PATCH] staging: rtl8192e: fix array of flexible structures Jitendra Khasdev
2021-04-27 18:10 ` Greg KH
2021-04-27 18:58   ` Jitendra
2021-04-28  6:01     ` Greg KH [this message]
2021-04-28  7:24       ` Jitendra
2021-04-29 14:20 ` Dan Carpenter

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=YIj6MUO5+EDBzOwl@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=jkhasdev@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).