From: Paul Louvel <paul.louvel@bootlin.com>
To: Herbert Xu <herbert@gondor.apana.org.au>, Rosen Penev <rosenp@gmail.com>
Cc: linux-crypto@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Kees Cook <kees@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
open list <linux-kernel@vger.kernel.org>,
open "list:KERNEL" HARDENING "(not" covered by other
"areas):Keyword:b__counted_by(_le|_be)?b"
<linux-hardening@vger.kernel.org>
Subject: Re: [PATCHv2] talitos: allocate channels with main struct
Date: Wed, 6 May 2026 10:47:30 +0200 [thread overview]
Message-ID: <4720f1f5-9aae-449f-a80c-eb3808876c6f@bootlin.com> (raw)
In-Reply-To: <afmo6sJlqbjCWd9A@gondor.apana.org.au>
FYI, all devices supported by the talitos driver has at least one channel.
The SEC1.2 (also called the SEC Lite) on the MPC885 SoC has one and only one
crypto channel.
On 5/5/26 10:23 AM, Herbert Xu wrote:
> On Tue, May 05, 2026 at 12:37:05AM -0700, Rosen Penev wrote:
>> Use a flexible array member to combine allocations.
>>
>> Add __counted_by for extra runtime analysis.
>>
>> Signed-off-by: Rosen Penev <rosenp@gmail.com>
>> ---
>> v2: add check for of_property_read_u32
>> drivers/crypto/talitos.c | 19 +++++++------------
>> drivers/crypto/talitos.h | 5 +++--
>> 2 files changed, 10 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
>> index bc61d0fe3514..e1f009684216 100644
>> --- a/drivers/crypto/talitos.c
>> +++ b/drivers/crypto/talitos.c
>> @@ -3409,14 +3409,20 @@ static int talitos_probe(struct platform_device *ofdev)
>> struct device *dev = &ofdev->dev;
>> struct device_node *np = ofdev->dev.of_node;
>> struct talitos_private *priv;
>> + unsigned int num_channels;
>> int i, err;
>> int stride;
>> struct resource *res;
>>
>> - priv = devm_kzalloc(dev, sizeof(struct talitos_private), GFP_KERNEL);
>> + if (of_property_read_u32(np, "fsl,num-channels", &num_channels))
>> + num_channels = 0;
> Does this driver still work with zero channels? It should just fail
> the probe.
>
> Thanks,
--
Paul Louvel, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
prev parent reply other threads:[~2026-05-06 8:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-05 7:37 [PATCHv2] talitos: allocate channels with main struct Rosen Penev
2026-05-05 8:23 ` Herbert Xu
2026-05-05 22:43 ` Rosen Penev
2026-05-06 8:47 ` Paul Louvel [this message]
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=4720f1f5-9aae-449f-a80c-eb3808876c6f@bootlin.com \
--to=paul.louvel@bootlin.com \
--cc=davem@davemloft.net \
--cc=gustavoars@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=kees@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rosenp@gmail.com \
/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