lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211201084108.GE9522@kadam>
Date:   Wed, 1 Dec 2021 11:41:08 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Zhou Qingyang <zhou1615@....edu>
Cc:     kjlu@....edu, Neil Armstrong <narmstrong@...libre.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Kevin Hilman <khilman@...libre.com>,
        Jerome Brunet <jbrunet@...libre.com>,
        Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
        Hans Verkuil <hverkuil-cisco@...all.nl>,
        Maxime Jourdan <mjourdan@...libre.com>,
        linux-media@...r.kernel.org, linux-amlogic@...ts.infradead.org,
        linux-staging@...ts.linux.dev,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] media: meson: vdec: Fix a NULL pointer dereference in
 amvdec_add_ts()

On Wed, Dec 01, 2021 at 12:12:23AM +0800, Zhou Qingyang wrote:
> diff --git a/drivers/staging/media/meson/vdec/vdec_helpers.c b/drivers/staging/media/meson/vdec/vdec_helpers.c
> index b9125c295d1d..41297c2f8f9a 100644
> --- a/drivers/staging/media/meson/vdec/vdec_helpers.c
> +++ b/drivers/staging/media/meson/vdec/vdec_helpers.c
> @@ -234,6 +234,11 @@ void amvdec_add_ts(struct amvdec_session *sess, u64 ts,
>  	unsigned long flags;
>  
>  	new_ts = kzalloc(sizeof(*new_ts), GFP_KERNEL);
> +	if (!new_ts) {
> +		dev_err(sess->core->dev_dec,
> +			"No enough memory in %s\n", __func__);
> +		return;

Please run checkpatch.pl on your patches.  The dev_err() message should
be deleted because kzalloc() already has a better message built in.

WARNING: Possible unnecessary 'out of memory' message
#50: FILE: drivers/staging/media/meson/vdec/vdec_helpers.c:238:
+       if (!new_ts) {
+               dev_err(sess->core->dev_dec,

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ