[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210914034032.orctp5ov5oc33vag@sidraya-laptopU>
Date: Tue, 14 Sep 2021 09:10:37 +0530
From: Sidraya Jayagond <sidraya.bj@...hpartnertech.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: gregkh@...uxfoundation.org, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org, prashanth.ka@...hpartnertech.com,
praneeth@...com, mchehab@...nel.org, linux-media@...r.kernel.org,
praveen.ap@...hpartnertech.com
Subject: Re: [PATCH 03/30] v4l: vxd-dec: Create vxd_dec Mem Manager helper
library
On Tue, Aug 24, 2021 at 04:34:38PM +0300, Dan Carpenter wrote:
> On Wed, Aug 18, 2021 at 07:40:10PM +0530, sidraya.bj@...hpartnertech.com wrote:
> > +int img_mem_create_ctx(struct mem_ctx **new_ctx)
> > +{
> > + struct mem_man *mem_man = &mem_man_data;
> > + struct mem_ctx *ctx;
> > +
> > + ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
> > + if (!ctx)
> > + return -ENOMEM;
> > +
> > + ctx->buffers = kzalloc(sizeof(*ctx->buffers), GFP_KERNEL);
> > + if (!ctx->buffers)
> > + return -ENOMEM;
>
> Smatch would have caught that this needs a kfree(ctx); before returning.
>
> It wouldn't hurt to run Smatch over this code.
>
> git clone https://repo.or.cz/w/smatch.git
> cd smatch
> yum install gcc make sqlite3 sqlite-devel sqlite perl-DBD-SQLite openssl-devel perl-Try-Tiny
> make
> cd ~/kernel/
> ~/smatch/smatch_scripts/kchecker drivers/staging/media/vxd/common/img_mem_man.c
>
> (I am the author of Smatch #BlowYourOwnTrumpet).
>
> regards,
> dan carpenter
>
I will run Smatch and will remove similar findings.
Thank you for reviewing.
--
This
message contains confidential information and is intended only
for the
individual(s) named. If you are not the intended
recipient, you are
notified that disclosing, copying, distributing or taking any
action in
reliance on the contents of this mail and attached file/s is strictly
prohibited. Please notify the
sender immediately and delete this e-mail
from your system. E-mail transmission
cannot be guaranteed to be secured or
error-free as information could be
intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain
viruses. The sender therefore does
not accept liability for any errors or
omissions in the contents of this
message, which arise as a result of e-mail
transmission.
Powered by blists - more mailing lists