stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, TOTE Robot <oslab@tsinghua.edu.cn>,
	Jia-Ju Bai <baijiaju1990@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.10 09/71] isdn: hfcpci: check the return value of dma_set_mask() in setup_hw()
Date: Mon, 14 Mar 2022 12:53:02 +0100	[thread overview]
Message-ID: <20220314112738.194878919@linuxfoundation.org> (raw)
In-Reply-To: <20220314112737.929694832@linuxfoundation.org>

From: Jia-Ju Bai <baijiaju1990@gmail.com>

[ Upstream commit d0aeb0d4a3f7d2a0df7e9545892bbeede8f2ac7e ]

The function dma_set_mask() in setup_hw() can fail, so its return value
should be checked.

Fixes: 1700fe1a10dc ("Add mISDN HFC PCI driver")
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/isdn/hardware/mISDN/hfcpci.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c
index bd087cca1c1d..af17459c1a5c 100644
--- a/drivers/isdn/hardware/mISDN/hfcpci.c
+++ b/drivers/isdn/hardware/mISDN/hfcpci.c
@@ -2005,7 +2005,11 @@ setup_hw(struct hfc_pci *hc)
 	}
 	/* Allocate memory for FIFOS */
 	/* the memory needs to be on a 32k boundary within the first 4G */
-	dma_set_mask(&hc->pdev->dev, 0xFFFF8000);
+	if (dma_set_mask(&hc->pdev->dev, 0xFFFF8000)) {
+		printk(KERN_WARNING
+		       "HFC-PCI: No usable DMA configuration!\n");
+		return -EIO;
+	}
 	buffer = dma_alloc_coherent(&hc->pdev->dev, 0x8000, &hc->hw.dmahandle,
 				    GFP_KERNEL);
 	/* We silently assume the address is okay if nonzero */
-- 
2.34.1




  parent reply	other threads:[~2022-03-14 12:04 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-14 11:52 [PATCH 5.10 00/71] 5.10.106-rc1 review Greg Kroah-Hartman
2022-03-14 11:52 ` [PATCH 5.10 01/71] ARM: boot: dts: bcm2711: Fix HVS register range Greg Kroah-Hartman
2022-03-14 11:52 ` [PATCH 5.10 02/71] clk: qcom: gdsc: Add support to update GDSC transition delay Greg Kroah-Hartman
2022-03-14 11:52 ` [PATCH 5.10 03/71] HID: vivaldi: fix sysfs attributes leak Greg Kroah-Hartman
2022-03-14 11:52 ` [PATCH 5.10 04/71] arm64: dts: armada-3720-turris-mox: Add missing ethernet0 alias Greg Kroah-Hartman
2022-03-14 11:52 ` [PATCH 5.10 05/71] tipc: fix kernel panic when enabling bearer Greg Kroah-Hartman
2022-03-14 11:52 ` [PATCH 5.10 06/71] mISDN: Remove obsolete PIPELINE_DEBUG debugging information Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 07/71] mISDN: Fix memory leak in dsp_pipeline_build() Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 08/71] virtio-blk: Dont use MAX_DISCARD_SEGMENTS if max_discard_seg is zero Greg Kroah-Hartman
2022-03-14 11:53 ` Greg Kroah-Hartman [this message]
2022-03-14 11:53 ` [PATCH 5.10 10/71] net: qlogic: check the return value of dma_alloc_coherent() in qed_vf_hw_prepare() Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 11/71] esp: Fix BEET mode inter address family tunneling on GSO Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 12/71] qed: return status of qed_iov_get_link Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 13/71] drm/sun4i: mixer: Fix P010 and P210 format numbers Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 14/71] net: dsa: mt7530: fix incorrect test in mt753x_phylink_validate() Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 15/71] ARM: dts: aspeed: Fix AST2600 quad spi group Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 16/71] i40e: stop disabling VFs due to PF error responses Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 17/71] ice: " Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 18/71] ice: Align macro names to the specification Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 19/71] ice: Remove unnecessary checker loop Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 20/71] ice: Rename a couple of variables Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 21/71] ice: Fix curr_link_speed advertised speed Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 22/71] ethernet: Fix error handling in xemaclite_of_probe Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 23/71] tipc: fix incorrect order of state message data sanity check Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 24/71] net: ethernet: ti: cpts: Handle error for clk_enable Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 25/71] net: ethernet: lpc_eth: " Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 26/71] ax25: Fix NULL pointer dereference in ax25_kill_by_device Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 27/71] net/mlx5: Fix size field in bufferx_reg struct Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 28/71] net/mlx5: Fix a race on command flush flow Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 29/71] net/mlx5e: Lag, Only handle events from highest priority multipath entry Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 30/71] NFC: port100: fix use-after-free in port100_send_complete Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 31/71] selftests: pmtu.sh: Kill tcpdump processes launched by subshell Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 32/71] gpio: ts4900: Do not set DAT and OE together Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 33/71] gianfar: ethtool: Fix refcount leak in gfar_get_ts_info Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 34/71] net: phy: DP83822: clear MISR2 register to disable interrupts Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 35/71] sctp: fix kernel-infoleak for SCTP sockets Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 36/71] net: bcmgenet: Dont claim WOL when its not available Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 37/71] selftests/bpf: Add test for bpf_timer overwriting crash Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 38/71] spi: rockchip: Fix error in getting num-cs property Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 39/71] spi: rockchip: terminate dma transmission when slave abort Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 40/71] net-sysfs: add check for netdevice being present to speed_show Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 41/71] hwmon: (pmbus) Clear pmbus fault/warning bits after read Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 42/71] gpio: Return EPROBE_DEFER if gc->to_irq is NULL Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 43/71] Revert "xen-netback: remove hotplug-status once it has served its purpose" Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 44/71] Revert "xen-netback: Check for hotplug-status existence before watching" Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 45/71] ipv6: prevent a possible race condition with lifetimes Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 46/71] tracing: Ensure trace buffer is at least 4096 bytes large Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 47/71] selftest/vm: fix map_fixed_noreplace test failure Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 48/71] selftests/memfd: clean up mapping in mfd_fail_write Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 49/71] ARM: Spectre-BHB: provide empty stub for non-config Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 50/71] fuse: fix pipe buffer lifetime for direct_io Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 51/71] staging: rtl8723bs: Fix access-point mode deadlock Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 52/71] staging: gdm724x: fix use after free in gdm_lte_rx() Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 53/71] net: macb: Fix lost RX packet wakeup race in NAPI receive Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 54/71] mmc: meson: Fix usage of meson_mmc_post_req() Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 55/71] riscv: Fix auipc+jalr relocation range checks Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 56/71] arm64: dts: marvell: armada-37xx: Remap IO space to bus address 0x0 Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 57/71] virtio: unexport virtio_finalize_features Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 58/71] virtio: acknowledge all features before access Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 59/71] watch_queue, pipe: Free watchqueue state after clearing pipe ring Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 60/71] watch_queue: Fix to release page in ->release() Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 61/71] watch_queue: Fix to always request a pow-of-2 pipe ring size Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 62/71] watch_queue: Fix the alloc bitmap size to reflect notes allocated Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 63/71] watch_queue: Free the alloc bitmap when the watch_queue is torn down Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 64/71] watch_queue: Fix lack of barrier/sync/lock between post and read Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 65/71] watch_queue: Make comment about setting ->defunct more accurate Greg Kroah-Hartman
2022-03-14 11:53 ` [PATCH 5.10 66/71] x86/boot: Fix memremap of setup_indirect structures Greg Kroah-Hartman
2022-03-14 11:54 ` [PATCH 5.10 67/71] x86/boot: Add setup_indirect support in early_memremap_is_setup_data() Greg Kroah-Hartman
2022-03-14 11:54 ` [PATCH 5.10 68/71] x86/traps: Mark do_int3() NOKPROBE_SYMBOL Greg Kroah-Hartman
2022-03-14 11:54 ` [PATCH 5.10 69/71] ext4: add check to prevent attempting to resize an fs with sparse_super2 Greg Kroah-Hartman
2022-03-14 11:54 ` [PATCH 5.10 70/71] ARM: fix Thumb2 regression with Spectre BHB Greg Kroah-Hartman
2022-03-14 11:54 ` [PATCH 5.10 71/71] watch_queue: Fix filter limit check Greg Kroah-Hartman
2022-03-14 17:00 ` [PATCH 5.10 00/71] 5.10.106-rc1 review Pavel Machek
2022-03-14 17:33 ` Fox Chen
2022-03-14 22:19 ` Florian Fainelli
2022-03-15  0:53 ` Guenter Roeck
2022-03-15  1:00 ` Samuel Zou
2022-03-15  6:31 ` Naresh Kamboju
2022-03-15  7:20 ` Bagas Sanjaya
2022-03-15  9:04 ` Jon Hunter
2022-03-15 12:34 ` Sudip Mukherjee

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=20220314112738.194878919@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=baijiaju1990@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oslab@tsinghua.edu.cn \
    --cc=sashal@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).