From: Dan Carpenter <dan.carpenter@oracle.com>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: linux-media@vger.kernel.org,
Mauro Carvalho Chehab <mchehab@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] [media] Siano: Use common error handling code in smsusb_init_device()
Date: Wed, 20 Sep 2017 16:56:06 +0300 [thread overview]
Message-ID: <20170920135605.sneukaioeabalkud@mwanda> (raw)
In-Reply-To: <be0003e5-d8e0-bff6-2205-7e88270ba2b4@users.sourceforge.net>
On Wed, Sep 20, 2017 at 02:40:28PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 20 Sep 2017 14:30:55 +0200
>
> Add a jump target so that a bit of exception handling can be better
> reused at the end of this function.
>
> This refactoring might fix also an error situation where the
> function "kfree" was not called after a software failure
> was noticed in two cases.
>
No. It doesn't fix a leak, it introduces a double free. If
smscore_register_device() succeeds then mdev is freed when we call
smsusb_term_device(intf); The call tree is:
smsusb_term_device()
-> smscore_unregister_device()
-> smscore_notify_clients()
-> smsdvb_onremove()
-> smsdvb_unregister_client()
-> smsdvb_media_device_unregister()
-> kfree(coredev->media_dev);
regards,
dan carpenter
next prev parent reply other threads:[~2017-09-20 13:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-20 12:40 SF Markus Elfring
2017-09-20 13:56 ` Dan Carpenter [this message]
2017-09-20 17:18 ` SF Markus Elfring
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=20170920135605.sneukaioeabalkud@mwanda \
--to=dan.carpenter@oracle.com \
--cc=elfring@users.sourceforge.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/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
all inboxes | Powered by JetHome®