* [PATCH 1/1] libnvdimm, namespace: fix the type of name variable
@ 2016-11-26 19:18 Nicolas Iooss
2016-11-28 21:26 ` Ross Zwisler
0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Iooss @ 2016-11-26 19:18 UTC (permalink / raw)
To: Dan Williams, linux-nvdimm; +Cc: Nicolas Iooss, linux-kernel
In create_namespace_blk(), the local variable "name" is defined as an
array of NSLABEL_NAME_LEN pointers:
char *name[NSLABEL_NAME_LEN];
This variable is then used in calls to memcpy() and kmemdup() as if it
were char[NSLABEL_NAME_LEN]. Remove the star in the variable definition
to makes it look right.
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
---
drivers/nvdimm/namespace_devs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index abe5c6bc756c..7569ba70cdde 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -1997,7 +1997,7 @@ struct device *create_namespace_blk(struct nd_region *nd_region,
struct nd_mapping *nd_mapping = &nd_region->mapping[0];
struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
struct nd_namespace_blk *nsblk;
- char *name[NSLABEL_NAME_LEN];
+ char name[NSLABEL_NAME_LEN];
struct device *dev = NULL;
struct resource *res;
--
2.10.2
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] libnvdimm, namespace: fix the type of name variable
2016-11-26 19:18 [PATCH 1/1] libnvdimm, namespace: fix the type of name variable Nicolas Iooss
@ 2016-11-28 21:26 ` Ross Zwisler
0 siblings, 0 replies; 2+ messages in thread
From: Ross Zwisler @ 2016-11-28 21:26 UTC (permalink / raw)
To: Nicolas Iooss; +Cc: linux-kernel, linux-nvdimm
On Sat, Nov 26, 2016 at 08:18:04PM +0100, Nicolas Iooss wrote:
> In create_namespace_blk(), the local variable "name" is defined as an
> array of NSLABEL_NAME_LEN pointers:
>
> char *name[NSLABEL_NAME_LEN];
>
> This variable is then used in calls to memcpy() and kmemdup() as if it
> were char[NSLABEL_NAME_LEN]. Remove the star in the variable definition
> to makes it look right.
>
> Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Yep, nice catch.
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-11-28 21:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-26 19:18 [PATCH 1/1] libnvdimm, namespace: fix the type of name variable Nicolas Iooss
2016-11-28 21:26 ` Ross Zwisler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox