From: "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
Bob Peterson <rpeterso@redhat.com>,
"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Subject: [PATCH for 4.9 03/59] GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next
Date: Thu, 14 Sep 2017 15:51:05 +0000 [thread overview]
Message-ID: <20170914155051.8289-3-alexander.levin@verizon.com> (raw)
In-Reply-To: <20170914155051.8289-1-alexander.levin@verizon.com>
From: Dan Carpenter <dan.carpenter@oracle.com>
[ Upstream commit 14d37564fa3dc4e5d4c6828afcd26ac14e6796c5 ]
This patch fixes a place where function gfs2_glock_iter_next can
reference an invalid error pointer.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
fs/gfs2/glock.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 7bff6f46f5da..95bc0ae71d81 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1820,16 +1820,18 @@ void gfs2_glock_exit(void)
static void gfs2_glock_iter_next(struct gfs2_glock_iter *gi)
{
- do {
- gi->gl = rhashtable_walk_next(&gi->hti);
+ while ((gi->gl = rhashtable_walk_next(&gi->hti))) {
if (IS_ERR(gi->gl)) {
if (PTR_ERR(gi->gl) == -EAGAIN)
continue;
gi->gl = NULL;
+ return;
}
- /* Skip entries for other sb and dead entries */
- } while ((gi->gl) && ((gi->sdp != gi->gl->gl_name.ln_sbd) ||
- __lockref_is_dead(&gi->gl->gl_lockref)));
+ /* Skip entries for other sb and dead entries */
+ if (gi->sdp == gi->gl->gl_name.ln_sbd &&
+ !__lockref_is_dead(&gi->gl->gl_lockref))
+ return;
+ }
}
static void *gfs2_glock_seq_start(struct seq_file *seq, loff_t *pos)
--
2.11.0
next prev parent reply other threads:[~2017-09-14 15:52 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` Levin, Alexander (Sasha Levin) [this message]
2017-09-14 15:51 ` [PATCH for 4.9 02/59] drm: bridge: add DT bindings for TI ths8135 Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 07/59] clk: sunxi-ng: set the parent rate when adjustin CPUX clock on A33 Levin, Alexander (Sasha Levin)
2017-09-15 2:02 ` icenowy
2017-09-15 2:08 ` Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 04/59] drm/i915: Fix the overlay frontbuffer tracking Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 06/59] clk: sunxi-ng: fix PLL_CPUX adjusting on H3 Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 05/59] ARM: dts: exynos: Add CPU OPPs for Exynos4412 Prime Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 08/59] RDS: RDMA: Fix the composite message user notification Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 10/59] MIPS: Ensure bss section ends on a long-aligned address Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 11/59] MIPS: fix mem=X@Y commandline processing Levin, Alexander (Sasha Levin)
2017-09-14 18:59 ` Mathieu Malaterre
2017-09-14 19:11 ` Levin, Alexander (Sasha Levin)
2017-09-14 19:17 ` Mathieu Malaterre
2017-09-15 5:44 ` Marcin Nowakowski
2017-09-15 17:03 ` Paul Burton
2017-09-14 15:51 ` [PATCH for 4.9 09/59] ARM: dts: r8a7790: Use R-Car Gen 2 fallback binding for msiof nodes Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 13/59] MIPS: ralink: Fix a typo in the pinmux setup Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 15/59] power: supply: axp288_fuel_gauge: Fix fuel_gauge_reg_readb return on error Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 14/59] MIPS: ralink: Fix incorrect assignment on ralink_soc Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 12/59] MIPS: kexec: Do not reserve invalid crashkernel memory on boot Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 17/59] ARM: dts: am335x-chilisom: Wakeup from RTC-only state by power on event Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 16/59] scsi: be2iscsi: Add checks to validate CID alloc/free Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 19/59] extcon: axp288: Use vbus-valid instead of -present to determine cable presence Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 21/59] sh_eth: use correct name for ECMR_MPDE bit Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 20/59] reset: ti_syscon: fix a ti_syscon_reset_status issue Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 18/59] igb: re-assign hw address pointer on reset after PCI error Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 22/59] clk/axs10x: Clear init field in driver probe Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 25/59] hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributes Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 24/59] usb: make the MTK XHCI driver compile for older MIPS SoCs Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 23/59] clk: wm831x: fix usleep_range with bad range Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 26/59] iio: adc: imx25-gcq: Fix module autoload Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 29/59] IB/rxe: Add a runtime check in alloc_index() Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 27/59] iio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 28/59] iio: adc: hx711: Add DT binding for avia,hx711 Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 31/59] ARM: 8635/1: nommu: allow enabling REMAP_VECTORS_TO_RAM Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 30/59] IB/rxe: Fix a MR reference leak in check_rkey() Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 32/59] drm/i915/psr: disable psr2 for resolution greater than 32X20 Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 33/59] serial: 8250: moxa: Store num_ports in brd Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 35/59] serial: 8250_port: Remove dangerous pr_debug() Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 34/59] tty: goldfish: Fix a parameter of a call to free_irq Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 37/59] IB/ipoib: rtnl_unlock can not come after free_netdev Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 36/59] IB/ipoib: Fix deadlock over vlan_mutex Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 40/59] drm/amdkfd: fix improper return value on error Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 41/59] USB: serial: mos7720: fix control-message error handling Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 39/59] arm: dts: mt2701: Add subsystem clock controller device nodes Levin, Alexander (Sasha Levin)
2017-09-15 11:15 ` Matthias Brugger
2017-09-17 23:20 ` Levin, Alexander (Sasha Levin)
2017-09-18 10:28 ` Matthias Brugger
2017-09-14 15:51 ` [PATCH for 4.9 38/59] IB/ipoib: Replace list_del of the neigh->list with list_del_init Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 42/59] USB: serial: mos7840: fix control-message error handling Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 45/59] partitions/efi: Fix integer overflow in GPT size calculation Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 43/59] sfc: get PIO buffer size from the NIC Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 44/59] pinctrl: mvebu: Use seq_puts() in mvebu_pinconf_group_dbg_show() Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 46/59] ASoC: dapm: handle probe deferrals Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 48/59] ath10k: prevent sta pointer rcu violation Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 49/59] spi: pxa2xx: Add support for Intel Gemini Lake Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 47/59] audit: log 32-bit socketcalls Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 53/59] ASoC: dapm: fix some pointer error handling Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 50/59] iommu/arm-smmu: Set privileged attribute to 'default' instead of 'unprivileged' Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 52/59] rtl8xxxu: Add additional USB IDs for rtl8192eu devices Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 51/59] usb: chipidea: vbus event may exist before starting gadget Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 54/59] drm: mali-dp: Fix destination size handling when rotating Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 55/59] drm: mali-dp: Fix transposed horizontal/vertical flip Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 56/59] HID: wacom: release the resources before leaving despite devm Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 57/59] MIPS: Lantiq: Fix another request_mem_region() return code check Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 59/59] lkdtm: Fix Oops when unloading the module Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 58/59] mips: ath79: clock:- Unmap region obtained by of_iomap Levin, Alexander (Sasha Levin)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170914155051.8289-3-alexander.levin@verizon.com \
--to=alexander.levin@verizon.com \
--cc=dan.carpenter@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rpeterso@redhat.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®