mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/5] treewide: fix signedness mixups in printf format specifiers
@ 2014-04-21 20:15 Lucas Stach
  2014-04-21 20:15 ` [PATCH 2/5] ARM: at91: add missing break Lucas Stach
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Lucas Stach @ 2014-04-21 20:15 UTC (permalink / raw)
  To: barebox

This most likely doesn't fix any real bugs, but it's the
right thing to do and reduces the noise level with static
checkers.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c | 2 +-
 arch/arm/boards/guf-cupid/board.c                 | 2 +-
 arch/arm/boards/phytec-phycore-imx35/pcm043.c     | 2 +-
 arch/arm/mach-imx/imx-bbu-internal.c              | 4 ++--
 commands/nandtest.c                               | 2 +-
 commands/time.c                                   | 2 +-
 common/tlsf_malloc.c                              | 2 +-
 drivers/clk/clk.c                                 | 2 +-
 drivers/misc/jtag.c                               | 2 +-
 drivers/usb/core/usb.c                            | 4 ++--
 lib/display_options.c                             | 2 +-
 lib/gui/picopng.c                                 | 2 +-
 scripts/kallsyms.c                                | 6 +++---
 scripts/kwbimage.c                                | 2 +-
 14 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
index 912e13c32cd7..9df2d64e3bee 100644
--- a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
+++ b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
@@ -347,7 +347,7 @@ static int do_cpufreq(int argc, char *argv[])
 		return COMMAND_ERROR_USAGE;
 	}
 
-	printf("Switched CPU frequency to %ldMHz\n", freq);
+	printf("Switched CPU frequency to %luMHz\n", freq);
 
 	return 0;
 }
diff --git a/arch/arm/boards/guf-cupid/board.c b/arch/arm/boards/guf-cupid/board.c
index 127edaa17089..356bf56a95cc 100644
--- a/arch/arm/boards/guf-cupid/board.c
+++ b/arch/arm/boards/guf-cupid/board.c
@@ -341,7 +341,7 @@ static int do_cpufreq(int argc, char *argv[])
 		return COMMAND_ERROR_USAGE;
 	}
 
-	printf("Switched CPU frequency to %ldMHz\n", freq);
+	printf("Switched CPU frequency to %luMHz\n", freq);
 
 	return 0;
 }
diff --git a/arch/arm/boards/phytec-phycore-imx35/pcm043.c b/arch/arm/boards/phytec-phycore-imx35/pcm043.c
index c1928cc8fff8..6abfc92c1116 100644
--- a/arch/arm/boards/phytec-phycore-imx35/pcm043.c
+++ b/arch/arm/boards/phytec-phycore-imx35/pcm043.c
@@ -319,7 +319,7 @@ static int do_cpufreq(int argc, char *argv[])
 		return COMMAND_ERROR_USAGE;
 	}
 
-	printf("Switched CPU frequency to %ldMHz\n", freq);
+	printf("Switched CPU frequency to %luMHz\n", freq);
 
 	return 0;
 }
diff --git a/arch/arm/mach-imx/imx-bbu-internal.c b/arch/arm/mach-imx/imx-bbu-internal.c
index 9861c0782b37..308a0bd9b89e 100644
--- a/arch/arm/mach-imx/imx-bbu-internal.c
+++ b/arch/arm/mach-imx/imx-bbu-internal.c
@@ -281,12 +281,12 @@ static int imx_bbu_internal_v2_write_nand_dbbt(struct imx_internal_bbu_handler *
 		}
 	}
 
-	debug("total image size: 0x%08x. Space needed including bad blocks: 0x%08x\n",
+	debug("total image size: 0x%08zx. Space needed including bad blocks: 0x%08zx\n",
 			data->len + 0x8000,
 			data->len + 0x8000 + *num_bb * blocksize);
 
 	if (data->len + 0x8000 + *num_bb * blocksize > imx_handler->device_size) {
-		printf("needed space (0x%08x) exceeds partition space (0x%08x)\n",
+		printf("needed space (0x%08zx) exceeds partition space (0x%08zx)\n",
 				data->len + 0x8000 + *num_bb * blocksize,
 				imx_handler->device_size);
 		ret = -ENOSPC;
diff --git a/commands/nandtest.c b/commands/nandtest.c
index c64f2443a8ee..373ee2c5da9e 100644
--- a/commands/nandtest.c
+++ b/commands/nandtest.c
@@ -161,7 +161,7 @@ static void print_stats(int nr_passes, int length)
 			* nr_passes);
 
 	for (i = 0; i < MAX_ECC_BITS; i++)
-		printf("ECC %d bit error(s)	: %d\n", i + 1, ecc_stats[i]);
+		printf("ECC %d bit error(s)	: %u\n", i + 1, ecc_stats[i]);
 
 	printf("ECC >%d bit error(s)	: %u\n", MAX_ECC_BITS, ecc_stats_over);
 	printf("ECC corrections failed	: %u\n", ecc_failed_cnt);
diff --git a/commands/time.c b/commands/time.c
index 2cc3292d7b14..ffd3062339b1 100644
--- a/commands/time.c
+++ b/commands/time.c
@@ -37,7 +37,7 @@ static int do_time(int argc, char *argv[])
 
 	diff = diff64;
 
-	printf("time: %ldms\n", diff);
+	printf("time: %lums\n", diff);
 
 	free(buf);
 
diff --git a/common/tlsf_malloc.c b/common/tlsf_malloc.c
index cd01b567b949..aa8fc13ea544 100644
--- a/common/tlsf_malloc.c
+++ b/common/tlsf_malloc.c
@@ -97,5 +97,5 @@ void malloc_stats(void)
 
 	tlsf_walk_heap(tlsf_mem_pool, malloc_walker, &s);
 
-	printf("used: %10d\nfree: %10d\n", s.used, s.free);
+	printf("used: %10zu\nfree: %10zu\n", s.used, s.free);
 }
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 0d259413a93b..23b1a7a7ea2c 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -428,7 +428,7 @@ static void dump_one(struct clk *clk, int verbose, int indent)
 {
 	struct clk *c;
 
-	printf("%*s%s (rate %ld, %sabled)\n", indent * 4, "", clk->name, clk_get_rate(clk),
+	printf("%*s%s (rate %lu, %sabled)\n", indent * 4, "", clk->name, clk_get_rate(clk),
 			clk_is_enabled(clk) ? "en" : "dis");
 	if (verbose) {
 
diff --git a/drivers/misc/jtag.c b/drivers/misc/jtag.c
index 310da810745f..f5d0c72ed541 100644
--- a/drivers/misc/jtag.c
+++ b/drivers/misc/jtag.c
@@ -276,7 +276,7 @@ static void jtag_info(struct device_d *pdev)
 	struct jtag_info *info = pdev->priv;
 
 	printf(" JTAG:\n");
-	printf("  Devices found: %d\n", info->devices);
+	printf("  Devices found: %u\n", info->devices);
 	for (dn = 0; dn < info->devices; dn++) {
 		jid.device = dn;
 		ret = jtag_ioctl(&info->cdev, JTAG_GET_ID, &jid);
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index fe1ac0280a59..9c1571d1908a 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -706,12 +706,12 @@ int usb_get_configuration_no(struct usb_device *dev,
 
 	if (tmp > USB_BUFSIZ) {
 		USB_PRINTF("usb_get_configuration_no: failed to get " \
-			   "descriptor - too long: %d\n", tmp);
+			   "descriptor - too long: %u\n", tmp);
 		return -1;
 	}
 
 	result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno, buffer, tmp);
-	USB_PRINTF("get_conf_no %d Result %d, wLength %d\n",
+	USB_PRINTF("get_conf_no %d Result %d, wLength %u\n",
 		   cfgno, result, tmp);
 	return result;
 }
diff --git a/lib/display_options.c b/lib/display_options.c
index 0871552aaa4e..2d695e4b7c7e 100644
--- a/lib/display_options.c
+++ b/lib/display_options.c
@@ -62,7 +62,7 @@ char *size_human_readable(unsigned long long size)
 
 	ptr += sprintf(buf, "%lu", n);
 	if (m) {
-		ptr += sprintf(ptr, ".%ld", m);
+		ptr += sprintf(ptr, ".%lu", m);
 	}
 	sprintf(ptr, " %ciB", c);
 
diff --git a/lib/gui/picopng.c b/lib/gui/picopng.c
index 77cd81cbad50..3c0659f368b2 100644
--- a/lib/gui/picopng.c
+++ b/lib/gui/picopng.c
@@ -800,7 +800,7 @@ int main(int argc, char **argv)
 #ifdef ALLOC_DEBUG
 	png_alloc_node_t *node;
 	for (node = png_alloc_head, n = 1; node; node = node->next, n++)
-		printf("node %d (%p) addr = %p, size = %ld\n", n, node, node->addr, node->size);
+		printf("node %d (%p) addr = %p, size = %zu\n", n, node, node->addr, node->size);
 #endif
 	png_alloc_free_all(); // also frees info and image data from PNG_decode
 
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index b3591a916bbb..9392f09181bc 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -286,7 +286,7 @@ static void write_src(void)
 	printf("\n");
 
 	output_label("kallsyms_num_syms");
-	printf("\tPTR\t%d\n", table_cnt);
+	printf("\tPTR\t%u\n", table_cnt);
 	printf("\n");
 
 	/* table of offset markers, that give the offset in the compressed stream
@@ -315,7 +315,7 @@ static void write_src(void)
 
 	output_label("kallsyms_markers");
 	for (i = 0; i < ((table_cnt + 255) >> 8); i++)
-		printf("\tPTR\t%d\n", markers[i]);
+		printf("\tPTR\t%u\n", markers[i]);
 	printf("\n");
 
 	free(markers);
@@ -332,7 +332,7 @@ static void write_src(void)
 
 	output_label("kallsyms_token_index");
 	for (i = 0; i < 256; i++)
-		printf("\t.short\t%d\n", best_idx[i]);
+		printf("\t.short\t%u\n", best_idx[i]);
 	printf("\n");
 }
 
diff --git a/scripts/kwbimage.c b/scripts/kwbimage.c
index f8abeb1781d5..5b8e73892cfb 100644
--- a/scripts/kwbimage.c
+++ b/scripts/kwbimage.c
@@ -1265,7 +1265,7 @@ static void image_dump_config(struct image_cfg_element *image_cfg,
 		struct image_cfg_element *e = &image_cfg[cfgi];
 		switch (e->type) {
 		case IMAGE_CFG_VERSION:
-			printf("VERSION %d\n", e->version);
+			printf("VERSION %u\n", e->version);
 			break;
 		case IMAGE_CFG_BOOT_FROM:
 			printf("BOOTFROM %s\n",
-- 
1.9.0


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

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

* [PATCH 2/5] ARM: at91: add missing break
  2014-04-21 20:15 [PATCH 1/5] treewide: fix signedness mixups in printf format specifiers Lucas Stach
@ 2014-04-21 20:15 ` Lucas Stach
  2014-04-22  1:14   ` Bo Shen
  2014-04-21 20:15 ` [PATCH 3/5] imx-image: don't leak file handle Lucas Stach
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Lucas Stach @ 2014-04-21 20:15 UTC (permalink / raw)
  To: barebox

Otherwise SAM A5d35 would be detected as A5d36.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 arch/arm/mach-at91/setup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 7a7de9804556..076d0812b356 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -162,6 +162,7 @@ static void __init soc_detect(u32 dbgu_base)
 			break;
 		case ARCH_EXID_SAMA5D35:
 			at91_soc_initdata.subtype = AT91_SOC_SAMA5D35;
+			break;
 		case ARCH_EXID_SAMA5D36:
 			at91_soc_initdata.subtype = AT91_SOC_SAMA5D36;
 			break;
-- 
1.9.0


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

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

* [PATCH 3/5] imx-image: don't leak file handle
  2014-04-21 20:15 [PATCH 1/5] treewide: fix signedness mixups in printf format specifiers Lucas Stach
  2014-04-21 20:15 ` [PATCH 2/5] ARM: at91: add missing break Lucas Stach
@ 2014-04-21 20:15 ` Lucas Stach
  2014-04-21 20:15 ` [PATCH 4/5] video: displaytimings: remove two broken error messages Lucas Stach
  2014-04-21 20:15 ` [PATCH 5/5] video: imx-ipu-v3: fix possible NULL ptr dereference Lucas Stach
  3 siblings, 0 replies; 8+ messages in thread
From: Lucas Stach @ 2014-04-21 20:15 UTC (permalink / raw)
  To: barebox

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 scripts/imx/imx-image.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c
index 1d935be7561d..f4890c44d7fa 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 cleanup;
 				}
 				break;
 			}
@@ -567,11 +567,13 @@ static int parse_config(const char *filename)
 
 		if (ret == -ENOENT) {
 			fprintf(stderr, "no such command: %s\n", argv[0]);
-			return ret;
+			goto cleanup;
 		}
 	}
 
-	return 0;
+cleanup:
+	fclose(f);
+	return ret;
 }
 
 static int xread(int fd, void *buf, int len)
-- 
1.9.0


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

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

* [PATCH 4/5] video: displaytimings: remove two broken error messages
  2014-04-21 20:15 [PATCH 1/5] treewide: fix signedness mixups in printf format specifiers Lucas Stach
  2014-04-21 20:15 ` [PATCH 2/5] ARM: at91: add missing break Lucas Stach
  2014-04-21 20:15 ` [PATCH 3/5] imx-image: don't leak file handle Lucas Stach
@ 2014-04-21 20:15 ` Lucas Stach
  2014-04-21 20:15 ` [PATCH 5/5] video: imx-ipu-v3: fix possible NULL ptr dereference Lucas Stach
  3 siblings, 0 replies; 8+ messages in thread
From: Lucas Stach @ 2014-04-21 20:15 UTC (permalink / raw)
  To: barebox

The error messages would dereference the just checked NULL
ptr. As those messages don't add much value without further
info just remove them.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 drivers/video/of_display_timing.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c
index 5dfd5b3f1cd0..eb29ec699ee6 100644
--- a/drivers/video/of_display_timing.c
+++ b/drivers/video/of_display_timing.c
@@ -109,10 +109,8 @@ int of_get_display_timing(struct device_node *np, const char *name,
 {
 	struct device_node *timing_np;
 
-	if (!np) {
-		pr_err("%s: no devicenode given\n", np->full_name);
+	if (!np)
 		return -EINVAL;
-	}
 
 	timing_np = of_get_child_by_name(np, name);
 	if (!timing_np) {
@@ -136,10 +134,8 @@ struct display_timings *of_get_display_timings(struct device_node *np)
 	struct device_node *native_mode;
 	struct display_timings *disp;
 
-	if (!np) {
-		pr_err("%s: no device node given\n", np->full_name);
+	if (!np)
 		return NULL;
-	}
 
 	timings_np = of_get_child_by_name(np, "display-timings");
 	if (!timings_np) {
-- 
1.9.0


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

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

* [PATCH 5/5] video: imx-ipu-v3: fix possible NULL ptr dereference
  2014-04-21 20:15 [PATCH 1/5] treewide: fix signedness mixups in printf format specifiers Lucas Stach
                   ` (2 preceding siblings ...)
  2014-04-21 20:15 ` [PATCH 4/5] video: displaytimings: remove two broken error messages Lucas Stach
@ 2014-04-21 20:15 ` Lucas Stach
  2014-04-21 20:43   ` Fabio Estevam
  3 siblings, 1 reply; 8+ messages in thread
From: Lucas Stach @ 2014-04-21 20:15 UTC (permalink / raw)
  To: barebox

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 drivers/video/imx-ipu-v3/ipu-dmfc.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/video/imx-ipu-v3/ipu-dmfc.c b/drivers/video/imx-ipu-v3/ipu-dmfc.c
index 7b54e25001c6..61704f4a9c06 100644
--- a/drivers/video/imx-ipu-v3/ipu-dmfc.c
+++ b/drivers/video/imx-ipu-v3/ipu-dmfc.c
@@ -146,16 +146,18 @@ EXPORT_SYMBOL_GPL(ipu_dmfc_disable_channel);
 static int ipu_dmfc_setup_channel(struct dmfc_channel *dmfc, int slots,
 		int segment, int burstsize)
 {
-	struct ipu_dmfc_priv *priv = dmfc->priv;
+	struct ipu_dmfc_priv *priv;
 	u32 val, field;
 
+	if (!dmfc)
+		return -EINVAL;
+
+	priv = dmfc->priv;
+
 	dev_dbg(priv->dev,
 			"dmfc: using %d slots starting from segment %d for IPU channel %d\n",
 			slots, segment, dmfc->data->ipu_channel);
 
-	if (!dmfc)
-		return -EINVAL;
-
 	switch (slots) {
 	case 1:
 		field = DMFC_FIFO_SIZE_64;
-- 
1.9.0


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

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

* Re: [PATCH 5/5] video: imx-ipu-v3: fix possible NULL ptr dereference
  2014-04-21 20:15 ` [PATCH 5/5] video: imx-ipu-v3: fix possible NULL ptr dereference Lucas Stach
@ 2014-04-21 20:43   ` Fabio Estevam
  2014-04-23  7:20     ` Sascha Hauer
  0 siblings, 1 reply; 8+ messages in thread
From: Fabio Estevam @ 2014-04-21 20:43 UTC (permalink / raw)
  To: Lucas Stach; +Cc: barebox

On Mon, Apr 21, 2014 at 5:15 PM, Lucas Stach <dev@lynxeye.de> wrote:
> Signed-off-by: Lucas Stach <dev@lynxeye.de>
> ---
>  drivers/video/imx-ipu-v3/ipu-dmfc.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/imx-ipu-v3/ipu-dmfc.c b/drivers/video/imx-ipu-v3/ipu-dmfc.c
> index 7b54e25001c6..61704f4a9c06 100644
> --- a/drivers/video/imx-ipu-v3/ipu-dmfc.c
> +++ b/drivers/video/imx-ipu-v3/ipu-dmfc.c
> @@ -146,16 +146,18 @@ EXPORT_SYMBOL_GPL(ipu_dmfc_disable_channel);
>  static int ipu_dmfc_setup_channel(struct dmfc_channel *dmfc, int slots,
>                 int segment, int burstsize)
>  {
> -       struct ipu_dmfc_priv *priv = dmfc->priv;
> +       struct ipu_dmfc_priv *priv;
>         u32 val, field;
>
> +       if (!dmfc)
> +               return -EINVAL;

Would be better to fix it in the same way we did in the kernel:
http://www.spinics.net/lists/linux-driver-devel/msg45096.html

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

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

* Re: [PATCH 2/5] ARM: at91: add missing break
  2014-04-21 20:15 ` [PATCH 2/5] ARM: at91: add missing break Lucas Stach
@ 2014-04-22  1:14   ` Bo Shen
  0 siblings, 0 replies; 8+ messages in thread
From: Bo Shen @ 2014-04-22  1:14 UTC (permalink / raw)
  To: Lucas Stach; +Cc: barebox

Hi Lucas Stach,

On 04/22/2014 04:15 AM, Lucas Stach wrote:
> Otherwise SAM A5d35 would be detected as A5d36.
>
> Signed-off-by: Lucas Stach <dev@lynxeye.de>

Acked-by: Bo Shen <voice.shen@atmel.com>

> ---
>   arch/arm/mach-at91/setup.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
> index 7a7de9804556..076d0812b356 100644
> --- a/arch/arm/mach-at91/setup.c
> +++ b/arch/arm/mach-at91/setup.c
> @@ -162,6 +162,7 @@ static void __init soc_detect(u32 dbgu_base)
>   			break;
>   		case ARCH_EXID_SAMA5D35:
>   			at91_soc_initdata.subtype = AT91_SOC_SAMA5D35;
> +			break;
>   		case ARCH_EXID_SAMA5D36:
>   			at91_soc_initdata.subtype = AT91_SOC_SAMA5D36;
>   			break;
>

Best Regards,
Bo Shen

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

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

* Re: [PATCH 5/5] video: imx-ipu-v3: fix possible NULL ptr dereference
  2014-04-21 20:43   ` Fabio Estevam
@ 2014-04-23  7:20     ` Sascha Hauer
  0 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2014-04-23  7:20 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: barebox

On Mon, Apr 21, 2014 at 05:43:46PM -0300, Fabio Estevam wrote:
> On Mon, Apr 21, 2014 at 5:15 PM, Lucas Stach <dev@lynxeye.de> wrote:
> > Signed-off-by: Lucas Stach <dev@lynxeye.de>
> > ---
> >  drivers/video/imx-ipu-v3/ipu-dmfc.c | 10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/video/imx-ipu-v3/ipu-dmfc.c b/drivers/video/imx-ipu-v3/ipu-dmfc.c
> > index 7b54e25001c6..61704f4a9c06 100644
> > --- a/drivers/video/imx-ipu-v3/ipu-dmfc.c
> > +++ b/drivers/video/imx-ipu-v3/ipu-dmfc.c
> > @@ -146,16 +146,18 @@ EXPORT_SYMBOL_GPL(ipu_dmfc_disable_channel);
> >  static int ipu_dmfc_setup_channel(struct dmfc_channel *dmfc, int slots,
> >                 int segment, int burstsize)
> >  {
> > -       struct ipu_dmfc_priv *priv = dmfc->priv;
> > +       struct ipu_dmfc_priv *priv;
> >         u32 val, field;
> >
> > +       if (!dmfc)
> > +               return -EINVAL;
> 
> Would be better to fix it in the same way we did in the kernel:
> http://www.spinics.net/lists/linux-driver-devel/msg45096.html

Just did that and applied this series.

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] 8+ messages in thread

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-21 20:15 [PATCH 1/5] treewide: fix signedness mixups in printf format specifiers Lucas Stach
2014-04-21 20:15 ` [PATCH 2/5] ARM: at91: add missing break Lucas Stach
2014-04-22  1:14   ` Bo Shen
2014-04-21 20:15 ` [PATCH 3/5] imx-image: don't leak file handle Lucas Stach
2014-04-21 20:15 ` [PATCH 4/5] video: displaytimings: remove two broken error messages Lucas Stach
2014-04-21 20:15 ` [PATCH 5/5] video: imx-ipu-v3: fix possible NULL ptr dereference Lucas Stach
2014-04-21 20:43   ` Fabio Estevam
2014-04-23  7:20     ` Sascha Hauer

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