From: Eric Farman <farman@linux.ibm.com>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
Matthew Rosato <mjrosato@linux.ibm.com>,
Halil Pasic <pasic@linux.ibm.com>,
Vineeth Vijayan <vneethv@linux.ibm.com>,
Peter Oberparleiter <oberpar@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH 1/2][next] vfio/ccw: Replace one-element array with flexible-array member
Date: Tue, 23 May 2023 12:33:54 -0400 [thread overview]
Message-ID: <fa2905e329f2e723228eb4750b305ae54be2a1ad.camel@linux.ibm.com> (raw)
In-Reply-To: <3c10549ebe1564eade68a2515bde233527376971.1684805398.git.gustavoars@kernel.org>
On Mon, 2023-05-22 at 19:35 -0600, Gustavo A. R. Silva wrote:
> One-element arrays are deprecated, and we are replacing them with
> flexible
> array members instead. So, replace one-element array with flexible-
> array
> member in struct vfio_ccw_parent and refactor the the rest of the
s/the the/the/
> code
> accordingly.
>
> Link: https://github.com/KSPP/linux/issues/79
> Link: https://github.com/KSPP/linux/issues/297
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
> ---
> drivers/s390/cio/vfio_ccw_drv.c | 3 ++-
> drivers/s390/cio/vfio_ccw_private.h | 2 +-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/s390/cio/vfio_ccw_drv.c
> b/drivers/s390/cio/vfio_ccw_drv.c
> index ff538a086fc7..57906a9c6324 100644
> --- a/drivers/s390/cio/vfio_ccw_drv.c
> +++ b/drivers/s390/cio/vfio_ccw_drv.c
> @@ -171,7 +171,8 @@ static int vfio_ccw_sch_probe(struct subchannel
> *sch)
> return -ENODEV;
> }
>
> - parent = kzalloc(sizeof(*parent), GFP_KERNEL);
> + parent = kzalloc(sizeof(*parent) + sizeof(struct mdev_type
> *),
> + GFP_KERNEL);
> if (!parent)
> return -ENOMEM;
>
> diff --git a/drivers/s390/cio/vfio_ccw_private.h
> b/drivers/s390/cio/vfio_ccw_private.h
> index b441ae6700fd..b62bbc5c6376 100644
> --- a/drivers/s390/cio/vfio_ccw_private.h
> +++ b/drivers/s390/cio/vfio_ccw_private.h
> @@ -79,7 +79,7 @@ struct vfio_ccw_parent {
>
> struct mdev_parent parent;
> struct mdev_type mdev_type;
> - struct mdev_type *mdev_types[1];
> + struct mdev_type *mdev_types[];
> };
>
> /**
next prev parent reply other threads:[~2023-05-23 16:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-23 1:34 [PATCH 0/2][next] vfio/ccw: Replace one-element array with flexible-array member Gustavo A. R. Silva
2023-05-23 1:35 ` [PATCH 1/2][next] " Gustavo A. R. Silva
2023-05-23 16:33 ` Eric Farman [this message]
2023-05-23 17:29 ` Kees Cook
2023-05-23 17:45 ` Christophe JAILLET
2023-05-23 17:47 ` Marion & Christophe JAILLET
2023-05-23 1:35 ` [PATCH 2/2][next] vfio/ccw: Use struct_size() helper Gustavo A. R. Silva
2023-05-23 16:33 ` Eric Farman
2023-05-23 17:30 ` Kees Cook
2023-05-23 16:36 ` [PATCH 0/2][next] vfio/ccw: Replace one-element array with flexible-array member Matthew Rosato
2023-05-23 18:58 ` Alexander Gordeev
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=fa2905e329f2e723228eb4750b305ae54be2a1ad.camel@linux.ibm.com \
--to=farman@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=gustavoars@kernel.org \
--cc=hca@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mjrosato@linux.ibm.com \
--cc=oberpar@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=svens@linux.ibm.com \
--cc=vneethv@linux.ibm.com \
/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).