From: Dan Carpenter <dan.carpenter@oracle.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: xkernel.wang@foxmail.com, nsaenz@kernel.org,
bcm-kernel-feedback-list@broadcom.com,
linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: mmal-vchiq: add a check for the return of vmalloc()
Date: Tue, 15 Mar 2022 18:53:14 +0300 [thread overview]
Message-ID: <20220315155314.GQ3293@kadam> (raw)
In-Reply-To: <YjCwagaijyA2oO8r@kroah.com>
On Tue, Mar 15, 2022 at 04:27:38PM +0100, Greg KH wrote:
> On Tue, Mar 15, 2022 at 10:42:07PM +0800, xkernel.wang@foxmail.com wrote:
> > From: Xiaoke Wang <xkernel.wang@foxmail.com>
> >
> > vmalloc() is a memory allocation API which can return NULL when some
> > internal memory errors happen. So it is better to check the return
> > value of it to catch the error in time.
> >
> > Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
> > ---
> > ChangeLog:
> > v1->v2 jump to the proper location and remove redundant instruction.
> > drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > index 76d3f03..ff4b484 100644
> > --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > @@ -1909,6 +1909,10 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance)
> > mutex_init(&instance->vchiq_mutex);
> >
> > instance->bulk_scratch = vmalloc(PAGE_SIZE);
> > + if (!instance->bulk_scratch) {
Is ->bulk_scratch even used anywhere?
regards,
dan carpenter
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: xkernel.wang@foxmail.com, nsaenz@kernel.org,
bcm-kernel-feedback-list@broadcom.com,
linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: mmal-vchiq: add a check for the return of vmalloc()
Date: Tue, 15 Mar 2022 18:53:14 +0300 [thread overview]
Message-ID: <20220315155314.GQ3293@kadam> (raw)
In-Reply-To: <YjCwagaijyA2oO8r@kroah.com>
On Tue, Mar 15, 2022 at 04:27:38PM +0100, Greg KH wrote:
> On Tue, Mar 15, 2022 at 10:42:07PM +0800, xkernel.wang@foxmail.com wrote:
> > From: Xiaoke Wang <xkernel.wang@foxmail.com>
> >
> > vmalloc() is a memory allocation API which can return NULL when some
> > internal memory errors happen. So it is better to check the return
> > value of it to catch the error in time.
> >
> > Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
> > ---
> > ChangeLog:
> > v1->v2 jump to the proper location and remove redundant instruction.
> > drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > index 76d3f03..ff4b484 100644
> > --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > @@ -1909,6 +1909,10 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance)
> > mutex_init(&instance->vchiq_mutex);
> >
> > instance->bulk_scratch = vmalloc(PAGE_SIZE);
> > + if (!instance->bulk_scratch) {
Is ->bulk_scratch even used anywhere?
regards,
dan carpenter
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-03-15 15:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-15 14:42 [PATCH v2] staging: mmal-vchiq: add a check for the return of vmalloc() xkernel.wang
2022-03-15 14:42 ` xkernel.wang
2022-03-15 15:27 ` Greg KH
2022-03-15 15:27 ` Greg KH
2022-03-15 15:53 ` Dan Carpenter [this message]
2022-03-15 15:53 ` Dan Carpenter
2022-03-15 16:23 ` Xiaoke Wang
2022-03-15 16:23 ` Xiaoke Wang
2022-03-16 14:08 ` gregkh
2022-03-16 14:08 ` gregkh
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=20220315155314.GQ3293@kadam \
--to=dan.carpenter@oracle.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=linux-staging@lists.linux.dev \
--cc=nsaenz@kernel.org \
--cc=xkernel.wang@foxmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.