Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1722445 > unrolled thread

[PATCH 0/2] MCB Patches for 4.14

Started byJohannes Thumshirn <jthumshirn@suse.de>
First post2017-08-29 14:50 +0200
Last post2017-08-29 14:50 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/2] MCB Patches for 4.14 Johannes Thumshirn <jthumshirn@suse.de> - 2017-08-29 14:50 +0200
    [PATCH 2/2] mcb: Fix an error handling path in 'chameleon_parse_cells()' Johannes Thumshirn <jthumshirn@suse.de> - 2017-08-29 14:50 +0200

#1722445 — [PATCH 0/2] MCB Patches for 4.14

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2017-08-29 14:50 +0200
Subject[PATCH 0/2] MCB Patches for 4.14
Message-ID<ujO7U-2G2-13@gated-at.bofh.it>
Hi Greg,

Here are the collected MCB patches for Kernel v4.14.

Christophe's patch fixes an error handling issue and Michael introduces a new
device id for LPC bus attached MCB devices. I also tagged this patch for inclusion
into stable.

All of them have been in my git tree at
git://git.kernel.org/pub/scm/linux/kernel/git/jth/linux.git mcb-for-4.14


Byte,
	Johannes

Christophe JAILLET (1):
  mcb: Fix an error handling path in 'chameleon_parse_cells()'

Michael Moese (1):
  MCB: add support for SC31 to mcb-lpc

 drivers/mcb/mcb-lpc.c   | 15 +++++++++++++++
 drivers/mcb/mcb-parse.c |  6 ++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

-- 
2.12.3

[toc] | [next] | [standalone]


#1722447 — [PATCH 2/2] mcb: Fix an error handling path in 'chameleon_parse_cells()'

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2017-08-29 14:50 +0200
Subject[PATCH 2/2] mcb: Fix an error handling path in 'chameleon_parse_cells()'
Message-ID<ujO7U-2G2-19@gated-at.bofh.it>
In reply to#1722445
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

If 'chameleon_get_bar()' fails, we will return 0, which mean success.
We should return the corresponding error code instead.

Remove the useless initialisation of 'ret' which was hiding the issue.
(if 'ret' is not set, gcc generates a warning ("warning: ‘ret’ may be used
uninitialized in this function"))

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 drivers/mcb/mcb-parse.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mcb/mcb-parse.c b/drivers/mcb/mcb-parse.c
index ee7fb6ec96bd..7369bda3442f 100644
--- a/drivers/mcb/mcb-parse.c
+++ b/drivers/mcb/mcb-parse.c
@@ -182,7 +182,7 @@ int chameleon_parse_cells(struct mcb_bus *bus, phys_addr_t mapbase,
 	int num_cells = 0;
 	uint32_t dtype;
 	int bar_count;
-	int ret = 0;
+	int ret;
 	u32 hsize;
 
 	hsize = sizeof(struct chameleon_fpga_header);
@@ -210,8 +210,10 @@ int chameleon_parse_cells(struct mcb_bus *bus, phys_addr_t mapbase,
 		 header->filename);
 
 	bar_count = chameleon_get_bar(&p, mapbase, &cb);
-	if (bar_count < 0)
+	if (bar_count < 0) {
+		ret = bar_count;
 		goto free_header;
+	}
 
 	for_each_chameleon_cell(dtype, p) {
 		switch (dtype) {
-- 
2.12.3

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web