mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 01/12] scripts: imx-image: Fix resource leak
@ 2014-04-12  8:10 Alexander Shiyan
  2014-04-12  8:10 ` [PATCH 02/12] gui: " Alexander Shiyan
                   ` (11 more replies)
  0 siblings, 12 replies; 16+ messages in thread
From: Alexander Shiyan @ 2014-04-12  8:10 UTC (permalink / raw)
  To: barebox

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 scripts/imx/imx-image.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c
index 1d935be..f87f4d2 100644
--- a/scripts/imx/imx-image.c
+++ b/scripts/imx/imx-image.c
@@ -528,7 +528,7 @@ static int parse_config(const char *filename)
 	int lineno = 0;
 	char *line = NULL, *tmp;
 	char *argv[MAXARGS];
-	int nargs, i, ret;
+	int nargs, i, ret = 0;
 
 	f = fopen(filename, "r");
 	if (!f) {
@@ -559,7 +559,7 @@ static int parse_config(const char *filename)
 				if (ret) {
 					fprintf(stderr, "error in line %d: %s\n",
 							lineno, strerror(-ret));
-					return ret;
+					goto out_parse;
 				}
 				break;
 			}
@@ -567,11 +567,14 @@ static int parse_config(const char *filename)
 
 		if (ret == -ENOENT) {
 			fprintf(stderr, "no such command: %s\n", argv[0]);
-			return ret;
+			break;
 		}
 	}
 
-	return 0;
+out_parse:
+	fclose(f);
+
+	return ret;
 }
 
 static int xread(int fd, void *buf, int len)
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 02/12] gui: Fix resource leak
  2014-04-12  8:10 [PATCH 01/12] scripts: imx-image: Fix resource leak Alexander Shiyan
@ 2014-04-12  8:10 ` Alexander Shiyan
  2014-04-12  8:10 ` [PATCH 03/12] lzo: Remove unused variable Alexander Shiyan
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Alexander Shiyan @ 2014-04-12  8:10 UTC (permalink / raw)
  To: barebox

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 lib/gui/picopng.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/gui/picopng.c b/lib/gui/picopng.c
index 77cd81c..e740b1c 100644
--- a/lib/gui/picopng.c
+++ b/lib/gui/picopng.c
@@ -761,9 +761,12 @@ int main(int argc, char **argv)
 	infp = fopen(fname, "rb");
 	if (!infp) {
 		perror("fopen");
+		free(inbuf);
 		return 1;
 	} else if (fread(inbuf, 1, insize, infp) != insize) {
 		perror("fread");
+		free(inbuf);
+		fclose(infp);
 		return 1;
 	}
 	fclose(infp);
@@ -793,6 +796,7 @@ int main(int argc, char **argv)
 		return 1;
 	} else if (fwrite(info->image->data, 1, outsize, outfp) != outsize) {
 		perror("fwrite");
+		fclose(outfp);
 		return 1;
 	}
 	fclose(outfp);
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 03/12] lzo: Remove unused variable
  2014-04-12  8:10 [PATCH 01/12] scripts: imx-image: Fix resource leak Alexander Shiyan
  2014-04-12  8:10 ` [PATCH 02/12] gui: " Alexander Shiyan
@ 2014-04-12  8:10 ` Alexander Shiyan
  2014-04-12  8:10 ` [PATCH 04/12] ubifs: " Alexander Shiyan
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Alexander Shiyan @ 2014-04-12  8:10 UTC (permalink / raw)
  To: barebox

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 lib/decompress_unlzo.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/decompress_unlzo.c b/lib/decompress_unlzo.c
index 5ee3667..10ad42a 100644
--- a/lib/decompress_unlzo.c
+++ b/lib/decompress_unlzo.c
@@ -56,7 +56,6 @@ static inline int parse_header(u8 *input, int *skip, int in_len)
 	int l;
 	u8 *parse = input;
 	u8 *end = input + in_len;
-	u8 level = 0;
 	u16 version;
 
 	/*
@@ -78,7 +77,7 @@ static inline int parse_header(u8 *input, int *skip, int in_len)
 	version = get_unaligned_be16(parse);
 	parse += 7;
 	if (version >= 0x0940)
-		level = *parse++;
+		parse++;
 	if (get_unaligned_be32(parse) & HEADER_HAS_FILTER)
 		parse += 8; /* flags + filter info */
 	else
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 04/12] ubifs: Remove unused variable
  2014-04-12  8:10 [PATCH 01/12] scripts: imx-image: Fix resource leak Alexander Shiyan
  2014-04-12  8:10 ` [PATCH 02/12] gui: " Alexander Shiyan
  2014-04-12  8:10 ` [PATCH 03/12] lzo: Remove unused variable Alexander Shiyan
@ 2014-04-12  8:10 ` Alexander Shiyan
  2014-04-12  8:10 ` [PATCH 05/12] commands/mount: Return real error code if "mount" fail Alexander Shiyan
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Alexander Shiyan @ 2014-04-12  8:10 UTC (permalink / raw)
  To: barebox

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 fs/ubifs/ubifs.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index 35923a9..49d5583 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -240,8 +240,6 @@ static struct inode *ubifs_findfile(struct super_block *sb, const char *filename
 		return ubifs_iget(sb, 1);
 
 	for (;;) {
-		struct ubifs_inode *ui;
-
 		/* Extract the actual part from the pathname.  */
 		next = strchr(name, '/');
 		if (next) {
@@ -257,8 +255,6 @@ static struct inode *ubifs_findfile(struct super_block *sb, const char *filename
 		if (!inode)
 			break;
 
-		ui = ubifs_inode(inode);
-
 		/*
 		 * Check if directory with this name exists
 		 */
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 05/12] commands/mount: Return real error code if "mount" fail
  2014-04-12  8:10 [PATCH 01/12] scripts: imx-image: Fix resource leak Alexander Shiyan
                   ` (2 preceding siblings ...)
  2014-04-12  8:10 ` [PATCH 04/12] ubifs: " Alexander Shiyan
@ 2014-04-12  8:10 ` Alexander Shiyan
  2014-04-23  9:47   ` Sascha Hauer
  2014-04-12  8:10 ` [PATCH 06/12] commands/uimage: Fix error printing Alexander Shiyan
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 16+ messages in thread
From: Alexander Shiyan @ 2014-04-12  8:10 UTC (permalink / raw)
  To: barebox

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 commands/mount.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands/mount.c b/commands/mount.c
index 691bc29..77efe71 100644
--- a/commands/mount.c
+++ b/commands/mount.c
@@ -115,7 +115,7 @@ static int do_mount(int argc, char *argv[])
 
 	if ((ret = mount(dev, type, mountpoint, fsoptions))) {
 		perror("mount");
-		return 1;
+		return ret;
 	}
 	return 0;
 }
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 06/12] commands/uimage: Fix error printing
  2014-04-12  8:10 [PATCH 01/12] scripts: imx-image: Fix resource leak Alexander Shiyan
                   ` (3 preceding siblings ...)
  2014-04-12  8:10 ` [PATCH 05/12] commands/mount: Return real error code if "mount" fail Alexander Shiyan
@ 2014-04-12  8:10 ` Alexander Shiyan
  2014-04-12  8:11 ` [PATCH 07/12] commands/umount: Return real error code if "umount" fail Alexander Shiyan
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Alexander Shiyan @ 2014-04-12  8:10 UTC (permalink / raw)
  To: barebox

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 commands/uimage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands/uimage.c b/commands/uimage.c
index 345e496..4b0ed4d 100644
--- a/commands/uimage.c
+++ b/commands/uimage.c
@@ -63,8 +63,8 @@ static int do_uimage(int argc, char *argv[])
 		printf("verifying data crc... ");
 		ret = uimage_verify(handle);
 		if (ret) {
-			goto err;
 			printf("Bad Data CRC\n");
+			goto err;
 		} else {
 			printf("ok\n");
 		}
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 07/12] commands/umount: Return real error code if "umount" fail
  2014-04-12  8:10 [PATCH 01/12] scripts: imx-image: Fix resource leak Alexander Shiyan
                   ` (4 preceding siblings ...)
  2014-04-12  8:10 ` [PATCH 06/12] commands/uimage: Fix error printing Alexander Shiyan
@ 2014-04-12  8:11 ` Alexander Shiyan
  2014-04-23  9:54   ` Sascha Hauer
  2014-04-12  8:11 ` [PATCH 08/12] commands/usbserial: Remove unused variable Alexander Shiyan
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 16+ messages in thread
From: Alexander Shiyan @ 2014-04-12  8:11 UTC (permalink / raw)
  To: barebox

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 commands/umount.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/commands/umount.c b/commands/umount.c
index e6de1bc..8dcf7f0 100644
--- a/commands/umount.c
+++ b/commands/umount.c
@@ -28,11 +28,10 @@ static int do_umount(int argc, char *argv[])
 	if (argc != 2)
 		return COMMAND_ERROR_USAGE;
 
-	if ((ret = umount(argv[1]))) {
+	if ((ret = umount(argv[1])))
 		perror("umount");
-		return 1;
-	}
-	return 0;
+
+	return ret;
 }
 
 static const __maybe_unused char cmd_umount_help[] =
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 08/12] commands/usbserial: Remove unused variable
  2014-04-12  8:10 [PATCH 01/12] scripts: imx-image: Fix resource leak Alexander Shiyan
                   ` (5 preceding siblings ...)
  2014-04-12  8:11 ` [PATCH 07/12] commands/umount: Return real error code if "umount" fail Alexander Shiyan
@ 2014-04-12  8:11 ` Alexander Shiyan
  2014-04-12  8:11 ` [PATCH 09/12] ata: pata-imx: " Alexander Shiyan
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Alexander Shiyan @ 2014-04-12  8:11 UTC (permalink / raw)
  To: barebox

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 commands/usbserial.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/commands/usbserial.c b/commands/usbserial.c
index bd5067f..969fd25 100644
--- a/commands/usbserial.c
+++ b/commands/usbserial.c
@@ -31,7 +31,6 @@ static int do_usbserial(int argc, char *argv[])
 {
 	int opt;
 	struct usb_serial_pdata pdata;
-	char *argstr;
 	char *manufacturer = "barebox";
 	const char *productname = barebox_get_model();
 	u16 idVendor = 0, idProduct = 0;
@@ -68,8 +67,6 @@ static int do_usbserial(int argc, char *argv[])
 		}
 	}
 
-	argstr = argv[optind];
-
 	pdata.manufacturer = manufacturer;
 	pdata.productname = productname;
 	pdata.idVendor = idVendor;
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 09/12] ata: pata-imx: Remove unused variable
  2014-04-12  8:10 [PATCH 01/12] scripts: imx-image: Fix resource leak Alexander Shiyan
                   ` (6 preceding siblings ...)
  2014-04-12  8:11 ` [PATCH 08/12] commands/usbserial: Remove unused variable Alexander Shiyan
@ 2014-04-12  8:11 ` Alexander Shiyan
  2014-04-12  8:11 ` [PATCH 10/12] imx_keypad: Fix error handling Alexander Shiyan
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Alexander Shiyan @ 2014-04-12  8:11 UTC (permalink / raw)
  To: barebox

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/ata/pata-imx.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/ata/pata-imx.c b/drivers/ata/pata-imx.c
index 7f9e39b..6bd7524 100644
--- a/drivers/ata/pata-imx.c
+++ b/drivers/ata/pata-imx.c
@@ -78,9 +78,6 @@ static void pata_imx_set_bus_timing(void __iomem *base, unsigned long clkrate,
 {
 	uint32_t T = 1000000000 / clkrate;
 
-	struct mxc_ata_config_regs *ata_regs;
-	ata_regs = (struct mxc_ata_config_regs *)base;
-
 	if (mode >= ARRAY_SIZE(pio_t1))
 		return;
 
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 10/12] imx_keypad: Fix error handling
  2014-04-12  8:10 [PATCH 01/12] scripts: imx-image: Fix resource leak Alexander Shiyan
                   ` (7 preceding siblings ...)
  2014-04-12  8:11 ` [PATCH 09/12] ata: pata-imx: " Alexander Shiyan
@ 2014-04-12  8:11 ` Alexander Shiyan
  2014-04-23  9:54   ` Sascha Hauer
  2014-04-12  8:11 ` [PATCH 11/12] mtd: partition: Remove unused variable Alexander Shiyan
                   ` (2 subsequent siblings)
  11 siblings, 1 reply; 16+ messages in thread
From: Alexander Shiyan @ 2014-04-12  8:11 UTC (permalink / raw)
  To: barebox

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/input/imx_keypad.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/input/imx_keypad.c b/drivers/input/imx_keypad.c
index e6870df..a1e2055 100644
--- a/drivers/input/imx_keypad.c
+++ b/drivers/input/imx_keypad.c
@@ -392,17 +392,17 @@ static int __init imx_keypad_probe(struct device_d *dev)
 	struct console_device *cdev;
 	int error, i;
 
-	keypad = xzalloc(sizeof(struct imx_keypad));
-	if (!keypad) {
-		pr_err("not enough memory for driver data\n");
-		error = -ENOMEM;
-	}
-
 	if (!keymap_data) {
 		pr_err("no keymap defined\n");
 		return -ENODEV;
 	}
 
+	keypad = xzalloc(sizeof(struct imx_keypad));
+	if (!keypad) {
+		pr_err("not enough memory for driver data\n");
+		return -ENOMEM;
+	}
+
 	keypad->dev = dev;
 	keypad->mmio_base = dev_request_mem_region(dev, 0);
 
@@ -420,8 +420,8 @@ static int __init imx_keypad_probe(struct device_d *dev)
 	if (keypad->rows_en_mask > ((1 << MAX_MATRIX_KEY_ROWS) - 1) ||
 	   keypad->cols_en_mask > ((1 << MAX_MATRIX_KEY_COLS) - 1)) {
 		pr_err("invalid key data (too many rows or colums)\n");
-		error = -EINVAL;
-		//goto failed_clock_put;
+		free(keypad);
+		return -EINVAL;
 	}
 	pr_debug("enabled rows mask: %x\n", keypad->rows_en_mask);
 	pr_debug("enabled cols mask: %x\n", keypad->cols_en_mask);
@@ -446,7 +446,6 @@ static int __init imx_keypad_probe(struct device_d *dev)
 	console_register(&keypad->cdev);
 
 	return poller_register(&keypad->poller);
-
 }
 
 static struct driver_d imx_keypad_driver = {
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 11/12] mtd: partition: Remove unused variable
  2014-04-12  8:10 [PATCH 01/12] scripts: imx-image: Fix resource leak Alexander Shiyan
                   ` (8 preceding siblings ...)
  2014-04-12  8:11 ` [PATCH 10/12] imx_keypad: Fix error handling Alexander Shiyan
@ 2014-04-12  8:11 ` Alexander Shiyan
  2014-04-12  8:11 ` [PATCH 12/12] mtd: nand: bbt: " Alexander Shiyan
  2014-04-23  9:56 ` [PATCH 01/12] scripts: imx-image: Fix resource leak Sascha Hauer
  11 siblings, 0 replies; 16+ messages in thread
From: Alexander Shiyan @ 2014-04-12  8:11 UTC (permalink / raw)
  To: barebox

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/mtd/partition.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/mtd/partition.c b/drivers/mtd/partition.c
index 720c2ad..c2461a0 100644
--- a/drivers/mtd/partition.c
+++ b/drivers/mtd/partition.c
@@ -7,11 +7,8 @@
 static int mtd_part_read(struct mtd_info *mtd, loff_t from, size_t len,
                 size_t *retlen, u_char *buf)
 {
-	struct mtd_ecc_stats stats;
 	int res;
 
-	stats = mtd->master->ecc_stats;
-
 	if (from >= mtd->size)
 		len = 0;
 	else if (from + len > mtd->size)
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 12/12] mtd: nand: bbt: Remove unused variable
  2014-04-12  8:10 [PATCH 01/12] scripts: imx-image: Fix resource leak Alexander Shiyan
                   ` (9 preceding siblings ...)
  2014-04-12  8:11 ` [PATCH 11/12] mtd: partition: Remove unused variable Alexander Shiyan
@ 2014-04-12  8:11 ` Alexander Shiyan
  2014-04-23  9:56 ` [PATCH 01/12] scripts: imx-image: Fix resource leak Sascha Hauer
  11 siblings, 0 replies; 16+ messages in thread
From: Alexander Shiyan @ 2014-04-12  8:11 UTC (permalink / raw)
  To: barebox

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/mtd/nand/nand_bbt.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
index b0548a3..1357c5c 100644
--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
@@ -551,7 +551,7 @@ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr
 {
 	struct nand_chip *this = mtd->priv;
 	int i, chips;
-	int bits, startblock, block, dir;
+	int startblock, block, dir;
 	int scanlen = mtd->writesize + mtd->oobsize;
 	int bbtblocks;
 	int blocktopage = this->bbt_erase_shift - this->page_shift;
@@ -575,9 +575,6 @@ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr
 		bbtblocks = mtd->size >> this->bbt_erase_shift;
 	}
 
-	/* Number of bits for each erase block in the bbt */
-	bits = td->options & NAND_BBT_NRBITS_MSK;
-
 	for (i = 0; i < chips; i++) {
 		/* Reset version information */
 		td->version[i] = 0;
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 05/12] commands/mount: Return real error code if "mount" fail
  2014-04-12  8:10 ` [PATCH 05/12] commands/mount: Return real error code if "mount" fail Alexander Shiyan
@ 2014-04-23  9:47   ` Sascha Hauer
  0 siblings, 0 replies; 16+ messages in thread
From: Sascha Hauer @ 2014-04-23  9:47 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On Sat, Apr 12, 2014 at 12:10:58PM +0400, Alexander Shiyan wrote:
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  commands/mount.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/commands/mount.c b/commands/mount.c
> index 691bc29..77efe71 100644
> --- a/commands/mount.c
> +++ b/commands/mount.c
> @@ -115,7 +115,7 @@ static int do_mount(int argc, char *argv[])
>  
>  	if ((ret = mount(dev, type, mountpoint, fsoptions))) {
>  		perror("mount");
> -		return 1;
> +		return ret;

The perror() should be removed then. Otherwise we get the same error
message twice.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 10/12] imx_keypad: Fix error handling
  2014-04-12  8:11 ` [PATCH 10/12] imx_keypad: Fix error handling Alexander Shiyan
@ 2014-04-23  9:54   ` Sascha Hauer
  0 siblings, 0 replies; 16+ messages in thread
From: Sascha Hauer @ 2014-04-23  9:54 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On Sat, Apr 12, 2014 at 12:11:03PM +0400, Alexander Shiyan wrote:
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  drivers/input/imx_keypad.c | 17 ++++++++---------
>  1 file changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/input/imx_keypad.c b/drivers/input/imx_keypad.c
> index e6870df..a1e2055 100644
> --- a/drivers/input/imx_keypad.c
> +++ b/drivers/input/imx_keypad.c
> @@ -392,17 +392,17 @@ static int __init imx_keypad_probe(struct device_d *dev)
>  	struct console_device *cdev;
>  	int error, i;
>  
> -	keypad = xzalloc(sizeof(struct imx_keypad));
> -	if (!keypad) {
> -		pr_err("not enough memory for driver data\n");
> -		error = -ENOMEM;
> -	}
> -
>  	if (!keymap_data) {
>  		pr_err("no keymap defined\n");
>  		return -ENODEV;
>  	}
>  
> +	keypad = xzalloc(sizeof(struct imx_keypad));
> +	if (!keypad) {
> +		pr_err("not enough memory for driver data\n");
> +		return -ENOMEM;
> +	}

No need to check the result from xzalloc. Removed this while applying.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 07/12] commands/umount: Return real error code if "umount" fail
  2014-04-12  8:11 ` [PATCH 07/12] commands/umount: Return real error code if "umount" fail Alexander Shiyan
@ 2014-04-23  9:54   ` Sascha Hauer
  0 siblings, 0 replies; 16+ messages in thread
From: Sascha Hauer @ 2014-04-23  9:54 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On Sat, Apr 12, 2014 at 12:11:00PM +0400, Alexander Shiyan wrote:
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  commands/umount.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/commands/umount.c b/commands/umount.c
> index e6de1bc..8dcf7f0 100644
> --- a/commands/umount.c
> +++ b/commands/umount.c
> @@ -28,11 +28,10 @@ static int do_umount(int argc, char *argv[])
>  	if (argc != 2)
>  		return COMMAND_ERROR_USAGE;
>  
> -	if ((ret = umount(argv[1]))) {
> +	if ((ret = umount(argv[1])))
>  		perror("umount");
> -		return 1;
> -	}

Here perror() also should be removed.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 01/12] scripts: imx-image: Fix resource leak
  2014-04-12  8:10 [PATCH 01/12] scripts: imx-image: Fix resource leak Alexander Shiyan
                   ` (10 preceding siblings ...)
  2014-04-12  8:11 ` [PATCH 12/12] mtd: nand: bbt: " Alexander Shiyan
@ 2014-04-23  9:56 ` Sascha Hauer
  11 siblings, 0 replies; 16+ messages in thread
From: Sascha Hauer @ 2014-04-23  9:56 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On Sat, Apr 12, 2014 at 12:10:54PM +0400, Alexander Shiyan wrote:
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>

Applied this series without 05/12 and 07/12 for now.

Sascha

> ---
>  scripts/imx/imx-image.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c
> index 1d935be..f87f4d2 100644
> --- a/scripts/imx/imx-image.c
> +++ b/scripts/imx/imx-image.c
> @@ -528,7 +528,7 @@ static int parse_config(const char *filename)
>  	int lineno = 0;
>  	char *line = NULL, *tmp;
>  	char *argv[MAXARGS];
> -	int nargs, i, ret;
> +	int nargs, i, ret = 0;
>  
>  	f = fopen(filename, "r");
>  	if (!f) {
> @@ -559,7 +559,7 @@ static int parse_config(const char *filename)
>  				if (ret) {
>  					fprintf(stderr, "error in line %d: %s\n",
>  							lineno, strerror(-ret));
> -					return ret;
> +					goto out_parse;
>  				}
>  				break;
>  			}
> @@ -567,11 +567,14 @@ static int parse_config(const char *filename)
>  
>  		if (ret == -ENOENT) {
>  			fprintf(stderr, "no such command: %s\n", argv[0]);
> -			return ret;
> +			break;
>  		}
>  	}
>  
> -	return 0;
> +out_parse:
> +	fclose(f);
> +
> +	return ret;
>  }
>  
>  static int xread(int fd, void *buf, int len)
> -- 
> 1.8.3.2
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-04-23  9:56 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-12  8:10 [PATCH 01/12] scripts: imx-image: Fix resource leak Alexander Shiyan
2014-04-12  8:10 ` [PATCH 02/12] gui: " Alexander Shiyan
2014-04-12  8:10 ` [PATCH 03/12] lzo: Remove unused variable Alexander Shiyan
2014-04-12  8:10 ` [PATCH 04/12] ubifs: " Alexander Shiyan
2014-04-12  8:10 ` [PATCH 05/12] commands/mount: Return real error code if "mount" fail Alexander Shiyan
2014-04-23  9:47   ` Sascha Hauer
2014-04-12  8:10 ` [PATCH 06/12] commands/uimage: Fix error printing Alexander Shiyan
2014-04-12  8:11 ` [PATCH 07/12] commands/umount: Return real error code if "umount" fail Alexander Shiyan
2014-04-23  9:54   ` Sascha Hauer
2014-04-12  8:11 ` [PATCH 08/12] commands/usbserial: Remove unused variable Alexander Shiyan
2014-04-12  8:11 ` [PATCH 09/12] ata: pata-imx: " Alexander Shiyan
2014-04-12  8:11 ` [PATCH 10/12] imx_keypad: Fix error handling Alexander Shiyan
2014-04-23  9:54   ` Sascha Hauer
2014-04-12  8:11 ` [PATCH 11/12] mtd: partition: Remove unused variable Alexander Shiyan
2014-04-12  8:11 ` [PATCH 12/12] mtd: nand: bbt: " Alexander Shiyan
2014-04-23  9:56 ` [PATCH 01/12] scripts: imx-image: Fix resource leak Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox