public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Akihiro TSUKADA <tskd08@gmail.com>
To: Vandana BN <bnvandana@gmail.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH] media:dvb-frontends:Return if Max devices are added in dvb_pll_attach().
Date: Thu, 18 Jul 2019 09:35:58 +0900	[thread overview]
Message-ID: <f8d9af33-d7d8-22d1-428f-b7b7c1d84062@gmail.com> (raw)
In-Reply-To: <20190717141204.19433-1-bnvandana@gmail.com>

Hi,

> diff --git a/drivers/media/dvb-frontends/dvb-pll.c b/drivers/media/dvb-frontends/dvb-pll.c
> index ba0c49107bd2..c850f1d69bce 100644
> --- a/drivers/media/dvb-frontends/dvb-pll.c
> +++ b/drivers/media/dvb-frontends/dvb-pll.c
> @@ -788,6 +788,9 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr,
>  	int ret;
>  	const struct dvb_pll_desc *desc;
> 
> +	if (dvb_pll_devcount > DVB_PLL_MAX - 1)
> +		return NULL;
> +
>  	b1 = kmalloc(1, GFP_KERNEL);
>  	if (!b1)
>  		return NULL;
> 

Wouldn't it put a limit on the number of attachment of devices?
I'm afraid that an user may repeatedly plugs in and off a device
using this driver (for some reason), and finally gets an error.

Since dvb_pll_devcount and "id" module parameter are just used
for debugging purpose to override/force PLL type,
removing them totally would be better, IMHO.

regards,
Akihiro

  reply	other threads:[~2019-07-18  0:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-17 14:12 [PATCH] media:dvb-frontends:Return if Max devices are added in dvb_pll_attach() Vandana BN
2019-07-18  0:35 ` Akihiro TSUKADA [this message]
2019-07-18  9:10   ` Vandana BN
2019-07-19  1:41     ` Akihiro TSUKADA
2019-07-19  7:02       ` Vandana BN
2019-07-20  6:13 ` [PATCH v2] media:dvb-frontends:Remove dvb_pll_devcount and id module parameters Vandana BN
2019-07-24  5:36   ` Sean Young
2019-08-01  5:09     ` Sean Young
2019-08-01  8:53       ` Vandana BN
2019-08-01  9:01     ` Michael Ira Krufky
2019-08-02  6:50       ` Vandana BN
2019-08-03  0:24         ` Sean Young

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=f8d9af33-d7d8-22d1-428f-b7b7c1d84062@gmail.com \
    --to=tskd08@gmail.com \
    --cc=bnvandana@gmail.com \
    --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