summaryrefslogtreecommitdiffstats
path: root/lib/bootstrap/devfs.c
Commit message (Collapse)AuthorAgeFilesLines
* bootstrap_read_devfs(): optionally inform the caller of the buffer sizeUlrich Ölmann2020-06-221-4/+7
| | | | | | | | The size of the buffer allocated in the function is needed if it shall be inspected more closely later. Therefore optionally return it via a new pointer argument. Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
* bootstrap: constify stringsTrent Piepho2016-01-081-1/+1
| | | | | | | Various parameters for device names, etc. should be const strings. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootstrap: Warn if image size in BB header is zeroAndrey Smirnov2015-05-071-1/+5
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootstrap_read_devfs(): Remove all partitions upon function completionAndrey Smirnov2015-05-071-2/+10
| | | | | | | | | | Bootstrap_read_devfs does not remove the devices it creates during the course of its execution which might be considered as a resource leak. Remedy that by adding the code to remove those devices upon function completion. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootstrap_read_devfs(): Check for errors from dev_add_bb_dev()Andrey Smirnov2015-05-071-2/+9
| | | | | | | | Check for errors returned by dev_add_bb_dev() and bail if there are any. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootstrap_read_devfs(): Fix potential memory leakAndrey Smirnov2015-05-071-6/+11
| | | | | | | | | | In case of a failure in one of the cdev_* functions original version of bootstrap_read_devfs would not release memory allocated for barebox header or memory allocated for the image. This commit fixes this by adding resource deallocation code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootstrap_read_devfs(): Close file after we are done with itAndrey Smirnov2015-05-071-0/+2
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootstrap_read_devfs(): Check for errors from devfs_add_partition()Andrey Smirnov2015-05-071-2/+9
| | | | | | | | Check for errors returned by devfs_add_partition() and bail if there are any. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootstrap: Fix potential memory leak in 'read_image_head'Andrey Smirnov2015-05-071-2/+6
| | | | | | | | | Original version of 'read_image_head' would not free the memory allocated for barebox header in cases of any failure. Fix this by adding a dedicated resourse de-allocation code path. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sizes.h: move include/sizes.h to include/linux/sizes.hMasahiro Yamada2015-01-081-1/+1
| | | | | | | | | | | | | | This file originates in Linux. Linux has it under include/linux/ directory since commit dccd2304cc90. Let's move it to the same place as well in barebox. This commit was generated by the following commands: find -name '*.[chS]' | xargs sed -i -e 's:<sizes.h>:<linux/sizes.h>:' git mv include/sizes.h include/linux/ Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce common bootstrap codeJean-Christophe PLAGNIOL-VILLARD2013-01-221-0/+118
This will allow to have a generic code to create different bootstrap As example Barebox as TI Xloader Barebox as AT91 Bootstrap Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>