All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.14 01/89] misc: mic: SCIF Fix scif_get_new_port() error handling
@ 2018-09-02 13:06 Sasha Levin
  2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 02/89] ALSA: hda/realtek - Add mute LED quirk for HP Spectre x360 Sasha Levin
                   ` (87 more replies)
  0 siblings, 88 replies; 95+ messages in thread
From: Sasha Levin @ 2018-09-02 13:06 UTC (permalink / raw)
  To: stable, linux-kernel; +Cc: Dan Carpenter, Greg Kroah-Hartman, Sasha Levin

From: Dan Carpenter <dan.carpenter@oracle.com>

[ Upstream commit a39284ae9d2ad09975c8ae33f1bd0f05fbfbf6ee ]

There are only 2 callers of scif_get_new_port() and both appear to get
the error handling wrong.  Both treat zero returns as error, but it
actually returns negative error codes and >= 0 on success.

Fixes: e9089f43c9a7 ("misc: mic: SCIF open close bind and listen APIs")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/misc/mic/scif/scif_api.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/misc/mic/scif/scif_api.c b/drivers/misc/mic/scif/scif_api.c
index ddc9e4b08b5c..56efa9d18a9a 100644
--- a/drivers/misc/mic/scif/scif_api.c
+++ b/drivers/misc/mic/scif/scif_api.c
@@ -370,11 +370,10 @@ int scif_bind(scif_epd_t epd, u16 pn)
 			goto scif_bind_exit;
 		}
 	} else {
-		pn = scif_get_new_port();
-		if (!pn) {
-			ret = -ENOSPC;
+		ret = scif_get_new_port();
+		if (ret < 0)
 			goto scif_bind_exit;
-		}
+		pn = ret;
 	}
 
 	ep->state = SCIFEP_BOUND;
@@ -648,13 +647,12 @@ int __scif_connect(scif_epd_t epd, struct scif_port_id *dst, bool non_block)
 			err = -EISCONN;
 		break;
 	case SCIFEP_UNBOUND:
-		ep->port.port = scif_get_new_port();
-		if (!ep->port.port) {
-			err = -ENOSPC;
-		} else {
-			ep->port.node = scif_info.nodeid;
-			ep->conn_async_state = ASYNC_CONN_IDLE;
-		}
+		err = scif_get_new_port();
+		if (err < 0)
+			break;
+		ep->port.port = err;
+		ep->port.node = scif_info.nodeid;
+		ep->conn_async_state = ASYNC_CONN_IDLE;
 		/* Fall through */
 	case SCIFEP_BOUND:
 		/*
-- 
2.17.1

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

end of thread, other threads:[~2018-09-12 17:31 UTC | newest]

Thread overview: 95+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-02 13:06 [PATCH AUTOSEL 4.14 01/89] misc: mic: SCIF Fix scif_get_new_port() error handling Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 02/89] ALSA: hda/realtek - Add mute LED quirk for HP Spectre x360 Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 03/89] ethtool: Remove trailing semicolon for static inline Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 04/89] i2c: aspeed: Add an explicit type casting for *get_clk_reg_val Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 05/89] Bluetooth: h5: Fix missing dependency on BT_HCIUART_SERDEV Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 06/89] gpio: tegra: Move driver registration to subsys_init level Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 07/89] powerpc/powernv: Fix concurrency issue with npu->mmio_atsd_usage Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 08/89] selftests/bpf: fix a typo in map in map test Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 09/89] media: davinci: vpif_display: Mix memory leak on probe error path Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 10/89] media: dw2102: Fix memleak on sequence of probes Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 11/89] net: phy: Fix the register offsets in Broadcom iProc mdio mux driver Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 12/89] scsi: qla2xxx: Fix unintended Logout Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 13/89] blk-mq: fix updating tags depth Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 14/89] scsi: target: fix __transport_register_session locking Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 15/89] media: usbtv: use irqsave() in USB's complete callback Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 16/89] md/raid5: fix data corruption of replacements after originals dropped Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 17/89] timers: Clear timer_base::must_forward_clk with timer_base::lock held Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 18/89] media: camss: csid: Configure data type and decode format properly Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 19/89] gpu: ipu-v3: default to id 0 on missing OF alias Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 20/89] misc: ti-st: Fix memory leak in the error path of probe() Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 21/89] uio: potential double frees if __uio_register_device() fails Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 22/89] firmware: vpd: Fix section enabled flag on vpd_section_destroy Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 23/89] Drivers: hv: vmbus: Cleanup synic memory free path Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 24/89] tty: rocket: Fix possible buffer overwrite on register_PCI Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 25/89] f2fs: fix to active page in lru list for read path Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 26/89] ftrace: Add missing check for existing hwlat thread Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 27/89] f2fs: do not set free of current section Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 28/89] f2fs: fix defined but not used build warnings Sasha Levin
2018-09-02 13:06   ` Sasha Levin via Linux-f2fs-devel
2018-09-02 13:06   ` Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 29/89] perf tools: Allow overriding MAX_NR_CPUS at compile time Sasha Levin
2018-09-02 13:06   ` Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 30/89] NFSv4.0 fix client reference leak in callback Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 31/89] perf c2c report: Fix crash for empty browser Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 32/89] fbdev/core: Disable console-lock warnings when fb.lockless_register_fb is set Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 33/89] perf evlist: Fix error out while applying initial delay and LBR Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 34/89] macintosh/via-pmu: Add missing mmio accessors Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 35/89] ath9k: report tx status on EOSP Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 36/89] ath9k_hw: fix channel maximum power level test Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 37/89] ath10k: prevent active scans on potential unusable channels Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 38/89] wlcore: Set rx_status boottime_ns field on rx Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 39/89] rpmsg: core: add support to power domains for devices Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 40/89] MIPS: Fix ISA virt/bus conversion for non-zero PHYS_OFFSET Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 41/89] ata: libahci: Allow reconfigure of DEVSLP register Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 42/89] ata: libahci: Correct setting " Sasha Levin
2018-09-02 13:06 ` [PATCH AUTOSEL 4.14 43/89] scsi: 3ware: fix return 0 on the error path of probe Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 44/89] tools/testing/nvdimm: kaddr and pfn can be NULL to ->direct_access() Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 45/89] ath10k: disable bundle mgmt tx completion event support Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 46/89] Bluetooth: hidp: Fix handling of strncpy for hid->name information Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 47/89] x86/mm: Remove in_nmi() warning from vmalloc_fault() Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 48/89] x86/kexec: Allocate 8k PGDs for PTI Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 49/89] ARM: 8783/1: NOMMU: Extend check for VBAR support Sasha Levin
2018-09-10  9:42   ` Vladimir Murzin
2018-09-10 14:12     ` Sasha Levin
2018-09-12 17:31     ` Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 50/89] pinctrl: imx: off by one in imx_pinconf_group_dbg_show() Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 51/89] gpio: ml-ioh: Fix buffer underwrite on probe error path Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 52/89] pinctrl/amd: only handle irq if it is pending and unmasked Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 53/89] net: mvneta: fix mtu change on port without link Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 54/89] f2fs: try grabbing node page lock aggressively in sync scenario Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 55/89] pktcdvd: Fix possible Spectre-v1 for pkt_devs Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 56/89] f2fs: fix to skip GC if type in SSA and SIT is inconsistent Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 57/89] tpm_tis_spi: Pass the SPI IRQ down to the driver Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 58/89] tpm/tpm_i2c_infineon: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 59/89] f2fs: fix to do sanity check with reserved blkaddr of inline inode Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 60/89] MIPS: Octeon: add missing of_node_put() Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 61/89] MIPS: generic: fix " Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 62/89] iio: ad9523: Fix return value for ad952x_store() Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 63/89] net: dcb: For wild-card lookups, use priority -1, not 0 Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 64/89] dm cache: only allow a single io_mode cache feature to be requested Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 65/89] Input: atmel_mxt_ts - only use first T9 instance Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 66/89] iommu/dma: Respect bus DMA limit for IOVAs Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 67/89] media: s5p-mfc: Fix buffer look up in s5p_mfc_handle_frame_{new, copy_time} functions Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 68/89] partitions/aix: append null character to print data from disk Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 69/89] partitions/aix: fix usage of uninitialized lv_info and lvname structures Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 70/89] media: helene: fix xtal frequency setting at power on Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 71/89] f2fs: fix to wait on page writeback before updating page Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 72/89] f2fs: Fix uninitialized return in f2fs_ioc_shutdown() Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 73/89] media: em28xx: Fix DualHD disconnect oops Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 74/89] iommu/ipmmu-vmsa: Fix allocation in atomic context Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 75/89] mfd: ti_am335x_tscadc: Fix struct clk memory leak Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 76/89] f2fs: fix to do sanity check with {sit,nat}_ver_bitmap_bytesize Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 77/89] ALSA: riptide: Properly endian notations Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 78/89] ALSA: pcm: Fix sparse warning wrt PCM format type Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 79/89] ALSA: wss: " Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 80/89] ALSA: sb: Fix PCM format bit calculation Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 81/89] ALSA: asihpi: Fix PCM format notations Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 82/89] ALSA: ad1816a: Fix sparse warning wrt PCM format type Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 83/89] ALSA: hda: Fix implicit PCM format type conversion Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 84/89] ALSA: au88x0: Fix sparse warning wrt PCM format type Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 85/89] ALSA: sb: " Sasha Levin
2018-09-02 13:07 ` [PATCH AUTOSEL 4.14 86/89] NFSv4.1: Fix a potential layoutget/layoutrecall deadlock Sasha Levin
2018-09-02 13:08 ` [PATCH AUTOSEL 4.14 87/89] MIPS: WARN_ON invalid DMA cache maintenance, not BUG_ON Sasha Levin
2018-09-02 13:08 ` [PATCH AUTOSEL 4.14 88/89] RDMA/cma: Do not ignore net namespace for unbound cm_id Sasha Levin
2018-09-02 13:08 ` [PATCH AUTOSEL 4.14 89/89] fuse: Add missed unlock_page() to fuse_readpages_fill() Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.