* [PATCH] w1: Fix number of bytes in error message
@ 2024-05-13 15:43 Thorsten Blum
2024-05-27 11:51 ` Krzysztof Kozlowski
0 siblings, 1 reply; 3+ messages in thread
From: Thorsten Blum @ 2024-05-13 15:43 UTC (permalink / raw)
To: Krzysztof Kozlowski; +Cc: linux-kernel, Thorsten Blum
Fix the number of bytes that failed to be allocated for a new w1 device.
Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
---
drivers/w1/w1_int.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c
index 3a71c5eb2f83..677e7167806c 100644
--- a/drivers/w1/w1_int.c
+++ b/drivers/w1/w1_int.c
@@ -34,7 +34,7 @@ static struct w1_master *w1_alloc_dev(u32 id, int slave_count, int slave_ttl,
dev = kzalloc(sizeof(struct w1_master) + sizeof(struct w1_bus_master), GFP_KERNEL);
if (!dev) {
pr_err("Failed to allocate %zd bytes for new w1 device.\n",
- sizeof(struct w1_master));
+ sizeof(struct w1_master) + sizeof(struct w1_bus_master));
return NULL;
}
--
2.45.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] w1: Fix number of bytes in error message
2024-05-13 15:43 [PATCH] w1: Fix number of bytes in error message Thorsten Blum
@ 2024-05-27 11:51 ` Krzysztof Kozlowski
2024-05-27 13:29 ` Thorsten Blum
0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2024-05-27 11:51 UTC (permalink / raw)
To: Thorsten Blum; +Cc: linux-kernel
On 13/05/2024 17:43, Thorsten Blum wrote:
> Fix the number of bytes that failed to be allocated for a new w1 device.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
> ---
> drivers/w1/w1_int.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c
> index 3a71c5eb2f83..677e7167806c 100644
> --- a/drivers/w1/w1_int.c
> +++ b/drivers/w1/w1_int.c
> @@ -34,7 +34,7 @@ static struct w1_master *w1_alloc_dev(u32 id, int slave_count, int slave_ttl,
> dev = kzalloc(sizeof(struct w1_master) + sizeof(struct w1_bus_master), GFP_KERNEL);
> if (!dev) {
> pr_err("Failed to allocate %zd bytes for new w1 device.\n",
> - sizeof(struct w1_master));
> + sizeof(struct w1_master) + sizeof(struct w1_bus_master));
No, instead error message should be dropped. Core handles printing
memory allocation failures.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] w1: Fix number of bytes in error message
2024-05-27 11:51 ` Krzysztof Kozlowski
@ 2024-05-27 13:29 ` Thorsten Blum
0 siblings, 0 replies; 3+ messages in thread
From: Thorsten Blum @ 2024-05-27 13:29 UTC (permalink / raw)
To: Krzysztof Kozlowski; +Cc: linux-kernel
On 27. May 2024, at 13:51, Krzysztof Kozlowski <krzk@kernel.org> wrote:
> On 13/05/2024 17:43, Thorsten Blum wrote:
>> Fix the number of bytes that failed to be allocated for a new w1 device.
>>
>> Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
>> ---
>> drivers/w1/w1_int.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c
>> index 3a71c5eb2f83..677e7167806c 100644
>> --- a/drivers/w1/w1_int.c
>> +++ b/drivers/w1/w1_int.c
>> @@ -34,7 +34,7 @@ static struct w1_master *w1_alloc_dev(u32 id, int slave_count, int slave_ttl,
>> dev = kzalloc(sizeof(struct w1_master) + sizeof(struct w1_bus_master), GFP_KERNEL);
>> if (!dev) {
>> pr_err("Failed to allocate %zd bytes for new w1 device.\n",
>> - sizeof(struct w1_master));
>> + sizeof(struct w1_master) + sizeof(struct w1_bus_master));
>
> No, instead error message should be dropped. Core handles printing
> memory allocation failures.
Ok, I'll submit a v2 shortly.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-05-27 13:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-13 15:43 [PATCH] w1: Fix number of bytes in error message Thorsten Blum
2024-05-27 11:51 ` Krzysztof Kozlowski
2024-05-27 13:29 ` Thorsten Blum
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®