From: Lars Hanisch <dvb@cinnamon-sage.de>
To: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
ldv-project@ispras.ru
Subject: Re: [PATCH] [media] ddbridge: fix error handling in module_init_ddbridge()
Date: Wed, 15 Aug 2012 23:00:28 +0200 [thread overview]
Message-ID: <502C0DEC.3010104@cinnamon-sage.de> (raw)
In-Reply-To: <1345063345-31131-1-git-send-email-khoroshilov@ispras.ru>
Hi,
Am 15.08.2012 22:42, schrieb Alexey Khoroshilov:
> If pci_register_driver() failed, resources allocated in
> ddb_class_create() are leaked. The patch fixes it.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
> ---
> drivers/media/dvb/ddbridge/ddbridge-core.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/dvb/ddbridge/ddbridge-core.c b/drivers/media/dvb/ddbridge/ddbridge-core.c
> index ebf3f05..36aa4e4 100644
> --- a/drivers/media/dvb/ddbridge/ddbridge-core.c
> +++ b/drivers/media/dvb/ddbridge/ddbridge-core.c
> @@ -1705,7 +1705,11 @@ static __init int module_init_ddbridge(void)
> "Copyright (C) 2010-11 Digital Devices GmbH\n");
> if (ddb_class_create())
> return -1;
> - return pci_register_driver(&ddb_pci_driver);
> + if (pci_register_driver(&ddb_pci_driver) < 0) {
> + ddb_class_destroy();
> + return -1;
Difference to before: the return value of pci_register_driver is not passed through.
Is this a problem? I'm just an interested application developer, not a driver developer.
Regards,
Lars.
> + }
> + return 0;
> }
>
> static __exit void module_exit_ddbridge(void)
>
next prev parent reply other threads:[~2012-08-15 21:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-15 20:42 [PATCH] [media] ddbridge: fix error handling in module_init_ddbridge() Alexey Khoroshilov
2012-08-15 21:00 ` Lars Hanisch [this message]
2012-08-15 23:13 ` Mauro Carvalho Chehab
2012-08-16 9:26 ` Mauro Carvalho Chehab
2012-08-16 9:36 ` Mauro Carvalho Chehab
-- strict thread matches above, loose matches on Subject: below --
2012-08-16 21:05 Alexey Khoroshilov
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=502C0DEC.3010104@cinnamon-sage.de \
--to=dvb@cinnamon-sage.de \
--cc=khoroshilov@ispras.ru \
--cc=ldv-project@ispras.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.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;
as well as URLs for NNTP newsgroup(s).