summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-pcf85063.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2019-05-02 17:30:29 +0300
committerRichard Weinberger <richard@nod.at>2019-05-06 22:48:46 +0300
commit1fca1f6abb38a6c2a082c1df01601d0898454d7a (patch)
tree9128108c68095e646de15643b5df547f0a8a5760 /drivers/rtc/rtc-pcf85063.c
parent22749bf549efb000c88d164c9a6a3366468e8e1c (diff)
downloadlinux-1fca1f6abb38a6c2a082c1df01601d0898454d7a.tar.xz
mtd: afs: simplify partition parsing
This simplifies the AFS partition parsing to make the code more straight-forward and readable. Before this patch the code tried to calculate the memory required to hold the partition info by adding up the sizes of the strings of the names and adding that to a single memory allocation, indexing the name pointers in front of the struct mtd_partition allocations so all allocated data was in one chunk. This is overzealous. Instead use kstrdup and bail out, kfree():ing the memory used for MTD partitions and names alike on the errorpath. In the process rename the index variable from idx to i. Cc: Ryan Harkin <ryan.harkin@linaro.org> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers/rtc/rtc-pcf85063.c')
0 files changed, 0 insertions, 0 deletions