mtd: concat: initialize *retlen
In concat_write and concat_read *retlen is only added to, but it's never initialized. If the caller hasn't initialized retlen doesn't contain valid values. Fix this by initializing *retlen properly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
db48d9d190
commit
4955c2c1bc
|
@ -66,6 +66,8 @@ concat_read(struct mtd_info *mtd, loff_t from, size_t len,
|
|||
int ret = 0, err;
|
||||
int i;
|
||||
|
||||
*retlen = 0;
|
||||
|
||||
for (i = 0; i < concat->num_subdev; i++) {
|
||||
struct mtd_info *subdev = concat->subdev[i];
|
||||
size_t size, retsize;
|
||||
|
@ -118,6 +120,8 @@ concat_write(struct mtd_info *mtd, loff_t to, size_t len,
|
|||
int err = -EINVAL;
|
||||
int i;
|
||||
|
||||
*retlen = 0;
|
||||
|
||||
for (i = 0; i < concat->num_subdev; i++) {
|
||||
struct mtd_info *subdev = concat->subdev[i];
|
||||
size_t size, retsize;
|
||||
|
|
Loading…
Reference in New Issue