public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2] media: atomisp: Add check for rgby_data memory allocation failure
  2024-11-04 14:50 [PATCH v2] media: atomisp: Add check for rgby_data memory allocation failure Li Huafei
@ 2024-11-04  8:22 ` Andy Shevchenko
  2024-11-04  8:25   ` Andy Shevchenko
  2024-11-04 10:15 ` Markus Elfring
  2024-11-04 12:04 ` Hans de Goede
  2 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2024-11-04  8:22 UTC (permalink / raw)
  To: Li Huafei
  Cc: mchehab, alan, hdegoede, sakari.ailus, gregkh, linux-media,
	linux-staging, linux-kernel

On Mon, Nov 04, 2024 at 10:50:51PM +0800, Li Huafei wrote:
> In ia_css_3a_statistics_allocate(), there is no check on the allocation
> result of the rgby_data memory. If rgby_data is not successfully
> allocated, it may trigger the assert(host_stats->rgby_data) assertion in
> ia_css_s3a_hmem_decode(). Adding a check to fix this potential issue.

...

> --- a/drivers/staging/media/atomisp/pci/sh_css_params.c
> +++ b/drivers/staging/media/atomisp/pci/sh_css_params.c
> @@ -4181,6 +4181,8 @@ ia_css_3a_statistics_allocate(const struct ia_css_3a_grid_info *grid)
>  		goto err;
>  	/* No weighted histogram, no structure, treat the histogram data as a byte dump in a byte array */
>  	me->rgby_data = kvmalloc(sizeof_hmem(HMEM0_ID), GFP_KERNEL);
> +	if (!me->rgby_data)
> +		goto err;

Which kernel version are you patching?

The problem, you have reported here was fixed ~4.5 years ago.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] media: atomisp: Add check for rgby_data memory allocation failure
  2024-11-04  8:22 ` Andy Shevchenko
@ 2024-11-04  8:25   ` Andy Shevchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2024-11-04  8:25 UTC (permalink / raw)
  To: Li Huafei
  Cc: mchehab, alan, hdegoede, sakari.ailus, gregkh, linux-media,
	linux-staging, linux-kernel

On Mon, Nov 04, 2024 at 10:22:53AM +0200, Andy Shevchenko wrote:
> On Mon, Nov 04, 2024 at 10:50:51PM +0800, Li Huafei wrote:
> > In ia_css_3a_statistics_allocate(), there is no check on the allocation
> > result of the rgby_data memory. If rgby_data is not successfully
> > allocated, it may trigger the assert(host_stats->rgby_data) assertion in
> > ia_css_s3a_hmem_decode(). Adding a check to fix this potential issue.

...

> > --- a/drivers/staging/media/atomisp/pci/sh_css_params.c
> > +++ b/drivers/staging/media/atomisp/pci/sh_css_params.c
> > @@ -4181,6 +4181,8 @@ ia_css_3a_statistics_allocate(const struct ia_css_3a_grid_info *grid)
> >  		goto err;
> >  	/* No weighted histogram, no structure, treat the histogram data as a byte dump in a byte array */
> >  	me->rgby_data = kvmalloc(sizeof_hmem(HMEM0_ID), GFP_KERNEL);
> > +	if (!me->rgby_data)
> > +		goto err;
> 
> Which kernel version are you patching?
> 
> The problem, you have reported here was fixed ~4.5 years ago.

Ah, sorry, I misread the line. Indeed, this one is still present in the current
code base.

Reviewed-by: Andy Shevchenko <andy@kernel.org>

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] media: atomisp: Add check for rgby_data memory allocation failure
  2024-11-04 14:50 [PATCH v2] media: atomisp: Add check for rgby_data memory allocation failure Li Huafei
  2024-11-04  8:22 ` Andy Shevchenko
@ 2024-11-04 10:15 ` Markus Elfring
  2024-11-04 10:54   ` Greg Kroah-Hartman
  2024-11-04 12:04 ` Hans de Goede
  2 siblings, 1 reply; 6+ messages in thread
From: Markus Elfring @ 2024-11-04 10:15 UTC (permalink / raw)
  To: Li Huafei, linux-media, linux-staging, Alan Cox,
	Mauro Carvalho Chehab
  Cc: LKML, Andy Shevchenko, Greg Kroah-Hartman, Hans de Goede,
	Sakari Ailus

…
> ia_css_s3a_hmem_decode(). Adding a check to fix this potential issue.

Please choose an imperative wording for an improved change description.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.12-rc5#n94

Regards,
Markus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] media: atomisp: Add check for rgby_data memory allocation failure
  2024-11-04 10:15 ` Markus Elfring
@ 2024-11-04 10:54   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2024-11-04 10:54 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Li Huafei, linux-media, linux-staging, Alan Cox,
	Mauro Carvalho Chehab, LKML, Andy Shevchenko, Hans de Goede,
	Sakari Ailus

On Mon, Nov 04, 2024 at 11:15:21AM +0100, Markus Elfring wrote:
> …
> > ia_css_s3a_hmem_decode(). Adding a check to fix this potential issue.
> 
> Please choose an imperative wording for an improved change description.
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.12-rc5#n94
> 
> Regards,
> Markus
> 

Hi,

This is the semi-friendly patch-bot of Greg Kroah-Hartman.

Markus, you seem to have sent a nonsensical or otherwise pointless
review comment to a patch submission on a Linux kernel developer mailing
list.  I strongly suggest that you not do this anymore.  Please do not
bother developers who are actively working to produce patches and
features with comments that, in the end, are a waste of time.

Patch submitter, please ignore Markus's suggestion; you do not need to
follow it at all.  The person/bot/AI that sent it is being ignored by
almost all Linux kernel maintainers for having a persistent pattern of
behavior of producing distracting and pointless commentary, and
inability to adapt to feedback.  Please feel free to also ignore emails
from them.

thanks,

greg k-h's patch email bot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] media: atomisp: Add check for rgby_data memory allocation failure
  2024-11-04 14:50 [PATCH v2] media: atomisp: Add check for rgby_data memory allocation failure Li Huafei
  2024-11-04  8:22 ` Andy Shevchenko
  2024-11-04 10:15 ` Markus Elfring
@ 2024-11-04 12:04 ` Hans de Goede
  2 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2024-11-04 12:04 UTC (permalink / raw)
  To: Li Huafei, mchehab, alan
  Cc: andy, sakari.ailus, gregkh, linux-media, linux-staging,
	linux-kernel

Hi,

On 4-Nov-24 3:50 PM, Li Huafei wrote:
> In ia_css_3a_statistics_allocate(), there is no check on the allocation
> result of the rgby_data memory. If rgby_data is not successfully
> allocated, it may trigger the assert(host_stats->rgby_data) assertion in
> ia_css_s3a_hmem_decode(). Adding a check to fix this potential issue.
> 
> Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
> Signed-off-by: Li Huafei <lihuafei1@huawei.com>

Thank you for your patch(es).

I have merged this/these in my media-atomisp branch:
https://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux.git/log/?h=media-atomisp

And this/these will be included in my next pull-request to
Mauro (to media subsystem maintainer)

Regards,

Hans




> ---
> Changes in v2:
>  - Corrects the "Fixes" tag.
> ---
>  drivers/staging/media/atomisp/pci/sh_css_params.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/staging/media/atomisp/pci/sh_css_params.c b/drivers/staging/media/atomisp/pci/sh_css_params.c
> index 232744973ab8..b1feb6f6ebe8 100644
> --- a/drivers/staging/media/atomisp/pci/sh_css_params.c
> +++ b/drivers/staging/media/atomisp/pci/sh_css_params.c
> @@ -4181,6 +4181,8 @@ ia_css_3a_statistics_allocate(const struct ia_css_3a_grid_info *grid)
>  		goto err;
>  	/* No weighted histogram, no structure, treat the histogram data as a byte dump in a byte array */
>  	me->rgby_data = kvmalloc(sizeof_hmem(HMEM0_ID), GFP_KERNEL);
> +	if (!me->rgby_data)
> +		goto err;
>  
>  	IA_CSS_LEAVE("return=%p", me);
>  	return me;


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] media: atomisp: Add check for rgby_data memory allocation failure
@ 2024-11-04 14:50 Li Huafei
  2024-11-04  8:22 ` Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Li Huafei @ 2024-11-04 14:50 UTC (permalink / raw)
  To: mchehab, alan
  Cc: andy, hdegoede, sakari.ailus, gregkh, linux-media, linux-staging,
	linux-kernel, lihuafei1

In ia_css_3a_statistics_allocate(), there is no check on the allocation
result of the rgby_data memory. If rgby_data is not successfully
allocated, it may trigger the assert(host_stats->rgby_data) assertion in
ia_css_s3a_hmem_decode(). Adding a check to fix this potential issue.

Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
Signed-off-by: Li Huafei <lihuafei1@huawei.com>
---
Changes in v2:
 - Corrects the "Fixes" tag.
---
 drivers/staging/media/atomisp/pci/sh_css_params.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/media/atomisp/pci/sh_css_params.c b/drivers/staging/media/atomisp/pci/sh_css_params.c
index 232744973ab8..b1feb6f6ebe8 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_params.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_params.c
@@ -4181,6 +4181,8 @@ ia_css_3a_statistics_allocate(const struct ia_css_3a_grid_info *grid)
 		goto err;
 	/* No weighted histogram, no structure, treat the histogram data as a byte dump in a byte array */
 	me->rgby_data = kvmalloc(sizeof_hmem(HMEM0_ID), GFP_KERNEL);
+	if (!me->rgby_data)
+		goto err;
 
 	IA_CSS_LEAVE("return=%p", me);
 	return me;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-11-04 12:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-04 14:50 [PATCH v2] media: atomisp: Add check for rgby_data memory allocation failure Li Huafei
2024-11-04  8:22 ` Andy Shevchenko
2024-11-04  8:25   ` Andy Shevchenko
2024-11-04 10:15 ` Markus Elfring
2024-11-04 10:54   ` Greg Kroah-Hartman
2024-11-04 12:04 ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox