Skip to content

Commit

Permalink
libnvdimm, namespace: fix the type of name variable
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Ross Zwisler <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
  • Loading branch information
fishilico authored and djbw committed Nov 28, 2016
1 parent 450c663 commit 238b323
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvdimm/namespace_devs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 238b323

Please sign in to comment.