* [PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation
@ 2020-11-25 14:05 ` Colin King
0 siblings, 0 replies; 14+ messages in thread
From: Colin King @ 2020-11-25 14:05 UTC (permalink / raw)
To: Barry Song, Christoph Hellwig, Marek Szyprowski, Robin Murphy,
iommu
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
An incorrect sizeof() is being used, sizeof(tsk) is not correct, it should
be sizeof(*tsk). Fix it.
Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)")
Fixes: bfd2defed94d ("dma-mapping: add benchmark support for streaming DMA APIs")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
kernel/dma/map_benchmark.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c
index e1e37603d01b..b1496e744c68 100644
--- a/kernel/dma/map_benchmark.c
+++ b/kernel/dma/map_benchmark.c
@@ -121,7 +121,7 @@ static int do_map_benchmark(struct map_benchmark_data *map)
int ret = 0;
int i;
- tsk = kmalloc_array(threads, sizeof(tsk), GFP_KERNEL);
+ tsk = kmalloc_array(threads, sizeof(*tsk), GFP_KERNEL);
if (!tsk)
return -ENOMEM;
--
2.29.2
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation
@ 2020-11-25 14:05 ` Colin King
0 siblings, 0 replies; 14+ messages in thread
From: Colin King @ 2020-11-25 14:05 UTC (permalink / raw)
To: Barry Song, Christoph Hellwig, Marek Szyprowski, Robin Murphy,
iommu
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
An incorrect sizeof() is being used, sizeof(tsk) is not correct, it should
be sizeof(*tsk). Fix it.
Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)")
Fixes: bfd2defed94d ("dma-mapping: add benchmark support for streaming DMA APIs")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
kernel/dma/map_benchmark.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c
index e1e37603d01b..b1496e744c68 100644
--- a/kernel/dma/map_benchmark.c
+++ b/kernel/dma/map_benchmark.c
@@ -121,7 +121,7 @@ static int do_map_benchmark(struct map_benchmark_data *map)
int ret = 0;
int i;
- tsk = kmalloc_array(threads, sizeof(tsk), GFP_KERNEL);
+ tsk = kmalloc_array(threads, sizeof(*tsk), GFP_KERNEL);
if (!tsk)
return -ENOMEM;
--
2.29.2
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply related [flat|nested] 14+ messages in thread* RE: [PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation
2020-11-25 14:05 ` Colin King
(?)
@ 2020-11-25 18:26 ` Song Bao Hua (Barry Song)
-1 siblings, 0 replies; 14+ messages in thread
From: Song Bao Hua (Barry Song) @ 2020-11-25 18:26 UTC (permalink / raw)
To: Colin King, Christoph Hellwig, Marek Szyprowski, Robin Murphy,
iommu@lists.linux-foundation.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogQ29saW4gS2luZyBbbWFp
bHRvOmNvbGluLmtpbmdAY2Fub25pY2FsLmNvbV0NCj4gU2VudDogVGh1cnNkYXksIE5vdmVtYmVy
IDI2LCAyMDIwIDM6MDUgQU0NCj4gVG86IFNvbmcgQmFvIEh1YSAoQmFycnkgU29uZykgPHNvbmcu
YmFvLmh1YUBoaXNpbGljb24uY29tPjsgQ2hyaXN0b3BoDQo+IEhlbGx3aWcgPGhjaEBsc3QuZGU+
OyBNYXJlayBTenlwcm93c2tpIDxtLnN6eXByb3dza2lAc2Ftc3VuZy5jb20+Ow0KPiBSb2JpbiBN
dXJwaHkgPHJvYmluLm11cnBoeUBhcm0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0tIGEva2VybmVsL2RtYS9tYXBfYmVuY2htYXJrLmMNCj4gKysrIGIva2VybmVsL2Rt
YS9tYXBfYmVuY2htYXJrLmMNCj4gQEAgLTEyMSw3ICsxMjEsNyBAQCBzdGF0aWMgaW50IGRvX21h
cF9iZW5jaG1hcmsoc3RydWN0DQo+IG1hcF9iZW5jaG1hcmtfZGF0YSAqbWFwKQ0KPiAgCWludCBy
ZXQgPSAwOw0KPiAgCWludCBpOw0KPiANCj4gLQl0c2sgPSBrbWFsbG9jX2FycmF5KHRocmVhZHMs
IHNpemVvZih0c2spLCBHRlBfS0VSTkVMKTsNCj4gKwl0c2sgPSBrbWFsbG9jX2FycmF5KHRocmVh
ZHMsIHNpemVvZigqdHNrKSwgR0ZQX0tFUk5FTCk7DQoNClRoZSBzaXplIGlzIHNhbWUuIEJ1dCB0
aGUgY2hhbmdlIGlzIGNvcnJlY3QuDQpBY2tlZC1ieTogQmFycnkgU29uZyA8c29uZy5iYW8uaHVh
QGhpc2lsaWNvbi5jb20+DQoNCj4gIAlpZiAoIXRzaykNCj4gIAkJcmV0dXJuIC1FTk9NRU07DQo+
IA0KVGhhbmtzDQpCYXJyeQ0KDQoNCg=
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation
@ 2020-11-25 18:26 ` Song Bao Hua (Barry Song)
0 siblings, 0 replies; 14+ messages in thread
From: Song Bao Hua (Barry Song) @ 2020-11-25 18:26 UTC (permalink / raw)
To: Colin King, Christoph Hellwig, Marek Szyprowski, Robin Murphy,
iommu@lists.linux-foundation.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
> -----Original Message-----
> From: Colin King [mailto:colin.king@canonical.com]
> Sent: Thursday, November 26, 2020 3:05 AM
> To: Song Bao Hua (Barry Song) <song.bao.hua@hisilicon.com>; Christoph
> Hellwig <hch@lst.de>; Marek Szyprowski <m.szyprowski@samsung.com>;
> Robin Murphy <robin.murphy@arm.com>; iommu@lists.linux-foundation.org
> Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation
>
> From: Colin Ian King <colin.king@canonical.com>
>
> An incorrect sizeof() is being used, sizeof(tsk) is not correct, it should
> be sizeof(*tsk). Fix it.
>
> Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)")
> Fixes: bfd2defed94d ("dma-mapping: add benchmark support for streaming
> DMA APIs")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> kernel/dma/map_benchmark.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c
> index e1e37603d01b..b1496e744c68 100644
> --- a/kernel/dma/map_benchmark.c
> +++ b/kernel/dma/map_benchmark.c
> @@ -121,7 +121,7 @@ static int do_map_benchmark(struct
> map_benchmark_data *map)
> int ret = 0;
> int i;
>
> - tsk = kmalloc_array(threads, sizeof(tsk), GFP_KERNEL);
> + tsk = kmalloc_array(threads, sizeof(*tsk), GFP_KERNEL);
The size is same. But the change is correct.
Acked-by: Barry Song <song.bao.hua@hisilicon.com>
> if (!tsk)
> return -ENOMEM;
>
Thanks
Barry
^ permalink raw reply [flat|nested] 14+ messages in thread* RE: [PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation
@ 2020-11-25 18:26 ` Song Bao Hua (Barry Song)
0 siblings, 0 replies; 14+ messages in thread
From: Song Bao Hua (Barry Song) @ 2020-11-25 18:26 UTC (permalink / raw)
To: Colin King, Christoph Hellwig, Marek Szyprowski, Robin Murphy,
iommu@lists.linux-foundation.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
> -----Original Message-----
> From: Colin King [mailto:colin.king@canonical.com]
> Sent: Thursday, November 26, 2020 3:05 AM
> To: Song Bao Hua (Barry Song) <song.bao.hua@hisilicon.com>; Christoph
> Hellwig <hch@lst.de>; Marek Szyprowski <m.szyprowski@samsung.com>;
> Robin Murphy <robin.murphy@arm.com>; iommu@lists.linux-foundation.org
> Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation
>
> From: Colin Ian King <colin.king@canonical.com>
>
> An incorrect sizeof() is being used, sizeof(tsk) is not correct, it should
> be sizeof(*tsk). Fix it.
>
> Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)")
> Fixes: bfd2defed94d ("dma-mapping: add benchmark support for streaming
> DMA APIs")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> kernel/dma/map_benchmark.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c
> index e1e37603d01b..b1496e744c68 100644
> --- a/kernel/dma/map_benchmark.c
> +++ b/kernel/dma/map_benchmark.c
> @@ -121,7 +121,7 @@ static int do_map_benchmark(struct
> map_benchmark_data *map)
> int ret = 0;
> int i;
>
> - tsk = kmalloc_array(threads, sizeof(tsk), GFP_KERNEL);
> + tsk = kmalloc_array(threads, sizeof(*tsk), GFP_KERNEL);
The size is same. But the change is correct.
Acked-by: Barry Song <song.bao.hua@hisilicon.com>
> if (!tsk)
> return -ENOMEM;
>
Thanks
Barry
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation
2020-11-25 18:26 ` Song Bao Hua (Barry Song)
(?)
@ 2020-11-25 18:29 ` Christoph Hellwig
-1 siblings, 0 replies; 14+ messages in thread
From: Christoph Hellwig @ 2020-11-25 18:29 UTC (permalink / raw)
To: Song Bao Hua (Barry Song)
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
iommu@lists.linux-foundation.org, Colin King, Robin Murphy,
Christoph Hellwig
I'll fold this one in as well.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation
@ 2020-11-25 18:29 ` Christoph Hellwig
0 siblings, 0 replies; 14+ messages in thread
From: Christoph Hellwig @ 2020-11-25 18:29 UTC (permalink / raw)
To: Song Bao Hua (Barry Song)
Cc: Colin King, Christoph Hellwig, Marek Szyprowski, Robin Murphy,
iommu@lists.linux-foundation.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
I'll fold this one in as well.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation
@ 2020-11-25 18:29 ` Christoph Hellwig
0 siblings, 0 replies; 14+ messages in thread
From: Christoph Hellwig @ 2020-11-25 18:29 UTC (permalink / raw)
To: Song Bao Hua (Barry Song)
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
iommu@lists.linux-foundation.org, Colin King, Robin Murphy,
Christoph Hellwig
I'll fold this one in as well.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation
2020-11-25 18:29 ` Christoph Hellwig
(?)
@ 2020-11-25 18:49 ` Colin Ian King
-1 siblings, 0 replies; 14+ messages in thread
From: Colin Ian King @ 2020-11-25 18:49 UTC (permalink / raw)
To: Christoph Hellwig, Song Bao Hua (Barry Song)
Cc: kernel-janitors@vger.kernel.org, iommu@lists.linux-foundation.org,
Robin Murphy, linux-kernel@vger.kernel.org
On 25/11/2020 18:29, Christoph Hellwig wrote:
> I'll fold this one in as well.
>
OK, so two SoB's disappear?
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation
@ 2020-11-25 18:49 ` Colin Ian King
0 siblings, 0 replies; 14+ messages in thread
From: Colin Ian King @ 2020-11-25 18:49 UTC (permalink / raw)
To: Christoph Hellwig, Song Bao Hua (Barry Song)
Cc: Marek Szyprowski, Robin Murphy, iommu@lists.linux-foundation.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
On 25/11/2020 18:29, Christoph Hellwig wrote:
> I'll fold this one in as well.
>
OK, so two SoB's disappear?
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation
@ 2020-11-25 18:49 ` Colin Ian King
0 siblings, 0 replies; 14+ messages in thread
From: Colin Ian King @ 2020-11-25 18:49 UTC (permalink / raw)
To: Christoph Hellwig, Song Bao Hua (Barry Song)
Cc: kernel-janitors@vger.kernel.org, iommu@lists.linux-foundation.org,
Robin Murphy, linux-kernel@vger.kernel.org
On 25/11/2020 18:29, Christoph Hellwig wrote:
> I'll fold this one in as well.
>
OK, so two SoB's disappear?
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation
2020-11-25 18:49 ` Colin Ian King
(?)
@ 2020-11-26 17:06 ` Christoph Hellwig
-1 siblings, 0 replies; 14+ messages in thread
From: Christoph Hellwig @ 2020-11-26 17:06 UTC (permalink / raw)
To: Colin Ian King
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
iommu@lists.linux-foundation.org, Robin Murphy, Christoph Hellwig
On Wed, Nov 25, 2020 at 06:49:19PM +0000, Colin Ian King wrote:
> On 25/11/2020 18:29, Christoph Hellwig wrote:
> > I'll fold this one in as well.
> >
> OK, so two SoB's disappear?
Yes, and are replaced by an annotation about folded fixes, just like
for all kinds of other commits.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation
@ 2020-11-26 17:06 ` Christoph Hellwig
0 siblings, 0 replies; 14+ messages in thread
From: Christoph Hellwig @ 2020-11-26 17:06 UTC (permalink / raw)
To: Colin Ian King
Cc: Christoph Hellwig, Song Bao Hua (Barry Song), Marek Szyprowski,
Robin Murphy, iommu@lists.linux-foundation.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
On Wed, Nov 25, 2020 at 06:49:19PM +0000, Colin Ian King wrote:
> On 25/11/2020 18:29, Christoph Hellwig wrote:
> > I'll fold this one in as well.
> >
> OK, so two SoB's disappear?
Yes, and are replaced by an annotation about folded fixes, just like
for all kinds of other commits.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation
@ 2020-11-26 17:06 ` Christoph Hellwig
0 siblings, 0 replies; 14+ messages in thread
From: Christoph Hellwig @ 2020-11-26 17:06 UTC (permalink / raw)
To: Colin Ian King
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
iommu@lists.linux-foundation.org, Robin Murphy, Christoph Hellwig
On Wed, Nov 25, 2020 at 06:49:19PM +0000, Colin Ian King wrote:
> On 25/11/2020 18:29, Christoph Hellwig wrote:
> > I'll fold this one in as well.
> >
> OK, so two SoB's disappear?
Yes, and are replaced by an annotation about folded fixes, just like
for all kinds of other commits.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2020-11-26 17:07 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-25 14:05 [PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation Colin King
2020-11-25 14:05 ` Colin King
2020-11-25 18:26 ` Song Bao Hua (Barry Song)
2020-11-25 18:26 ` Song Bao Hua (Barry Song)
2020-11-25 18:26 ` Song Bao Hua (Barry Song)
2020-11-25 18:29 ` Christoph Hellwig
2020-11-25 18:29 ` Christoph Hellwig
2020-11-25 18:29 ` Christoph Hellwig
2020-11-25 18:49 ` Colin Ian King
2020-11-25 18:49 ` Colin Ian King
2020-11-25 18:49 ` Colin Ian King
2020-11-26 17:06 ` Christoph Hellwig
2020-11-26 17:06 ` Christoph Hellwig
2020-11-26 17:06 ` Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.