linux-kernel.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, Varun Prakash <varun@chelsio.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 4.9 113/117] scsi: libcxgbi: add a check for NULL pointer in cxgbi_check_route()
Date: Thu, 20 Jun 2019 19:57:27 +0200	[thread overview]
Message-ID: <20190620174358.274189329@linuxfoundation.org> (raw)
In-Reply-To: <20190620174351.964339809@linuxfoundation.org>

[ Upstream commit cc555759117e8349088e0c5d19f2f2a500bafdbd ]

ip_dev_find() can return NULL so add a check for NULL pointer.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/cxgbi/libcxgbi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index 2ffe029ff2b6..e974106f2bb5 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -637,6 +637,10 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr)
 
 	if (ndev->flags & IFF_LOOPBACK) {
 		ndev = ip_dev_find(&init_net, daddr->sin_addr.s_addr);
+		if (!ndev) {
+			err = -ENETUNREACH;
+			goto rel_neigh;
+		}
 		mtu = ndev->mtu;
 		pr_info("rt dev %s, loopback -> %s, mtu %u.\n",
 			n->dev->name, ndev->name, mtu);
-- 
2.20.1




  parent reply	other threads:[~2019-06-20 18:07 UTC|newest]

Thread overview: 121+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20 17:55 [PATCH 4.9 000/117] 4.9.183-stable review Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 001/117] rapidio: fix a NULL pointer dereference when create_workqueue() fails Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 002/117] fs/fat/file.c: issue flush after the writeback of FAT Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 003/117] sysctl: return -EINVAL if val violates minmax Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 004/117] ipc: prevent lockup on alloc_msg and free_msg Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 005/117] ARM: prevent tracing IPI_CPU_BACKTRACE Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 006/117] hugetlbfs: on restore reserve error path retain subpool reservation Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 007/117] mem-hotplug: fix node spanned pages when we have a node with only ZONE_MOVABLE Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 008/117] mm/cma.c: fix crash on CMA allocation if bitmap allocation fails Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 009/117] mm/cma_debug.c: fix the break condition in cma_maxchunk_get() Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 010/117] mm/slab.c: fix an infinite loop in leaks_show() Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 011/117] kernel/sys.c: prctl: fix false positive in validate_prctl_map() Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 012/117] drivers: thermal: tsens: Dont print error message on -EPROBE_DEFER Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 013/117] mfd: tps65912-spi: Add missing of table registration Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 014/117] mfd: intel-lpss: Set the device in reset state when init Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 015/117] mfd: twl6040: Fix device init errors for ACCCTL register Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 016/117] perf/x86/intel: Allow PEBS multi-entry in watermark mode Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 017/117] drm/bridge: adv7511: Fix low refresh rate selection Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 018/117] objtool: Dont use ignore flag for fake jumps Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 019/117] pwm: meson: Use the spin-lock only to protect register modifications Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 020/117] ntp: Allow TAI-UTC offset to be set to zero Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 021/117] f2fs: fix to avoid panic in do_recover_data() Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 022/117] f2fs: fix to clear dirty inode in error path of f2fs_iget() Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 023/117] f2fs: fix to do sanity check on valid block count of segment Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 024/117] configfs: fix possible use-after-free in configfs_register_group Greg Kroah-Hartman
2019-06-20 17:55 ` [PATCH 4.9 025/117] uml: fix a boot splat wrt use of cpu_all_mask Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 026/117] watchdog: imx2_wdt: Fix set_timeout for big timeout values Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 027/117] watchdog: fix compile time error of pretimeout governors Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 028/117] iommu/vt-d: Set intel_iommu_gfx_mapped correctly Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 029/117] ALSA: hda - Register irq handler after the chip initialization Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 030/117] nvmem: core: fix read buffer in place Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 031/117] fuse: retrieve: cap requested size to negotiated max_write Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 032/117] nfsd: allow fh_want_write to be called twice Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 033/117] x86/PCI: Fix PCI IRQ routing table memory leak Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 034/117] platform/chrome: cros_ec_proto: check for NULL transfer function Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 035/117] soc: mediatek: pwrap: Zero initialize rdata in pwrap_init_cipher Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 036/117] clk: rockchip: Turn on "aclk_dmac1" for suspend on rk3288 Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 037/117] ARM: dts: imx6sx: Specify IMX6SX_CLK_IPG as "ahb" clock to SDMA Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 038/117] ARM: dts: imx7d: Specify IMX7D_CLK_IPG as "ipg" " Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 039/117] ARM: dts: imx6ul: Specify IMX6UL_CLK_IPG " Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 040/117] ARM: dts: imx6sx: Specify IMX6SX_CLK_IPG " Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 041/117] ARM: dts: imx6qdl: Specify IMX6QDL_CLK_IPG " Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 042/117] PCI: rpadlpar: Fix leaked device_node references in add/remove paths Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 043/117] platform/x86: intel_pmc_ipc: adding error handling Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 044/117] PCI: rcar: Fix a potential NULL pointer dereference Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 045/117] PCI: rcar: Fix 64bit MSI message address handling Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 046/117] video: hgafb: fix potential NULL pointer dereference Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 047/117] video: imsttfb: fix potential NULL pointer dereferences Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 048/117] PCI: xilinx: Check for __get_free_pages() failure Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 049/117] gpio: gpio-omap: add check for off wake capable gpios Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 050/117] dmaengine: idma64: Use actual device for DMA transfers Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 051/117] pwm: tiehrpwm: Update shadow register for disabling PWMs Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 052/117] ARM: dts: exynos: Always enable necessary APIO_1V8 and ABB_1V8 regulators on Arndale Octa Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 053/117] pwm: Fix deadlock warning when removing PWM device Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 054/117] ARM: exynos: Fix undefined instruction during Exynos5422 resume Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 055/117] Revert "Bluetooth: Align minimum encryption key size for LE and BR/EDR connections" Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 056/117] ALSA: seq: Cover unsubscribe_port() in list_mutex Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 057/117] ALSA: oxfw: allow PCM capture for Stanton SCS.1m Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 058/117] libata: Extend quirks for the ST1000LM024 drives with NOLPM quirk Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 059/117] mm/list_lru.c: fix memory leak in __memcg_init_list_lru_node Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 060/117] fs/ocfs2: fix race in ocfs2_dentry_attach_lock() Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 061/117] [PATCH] signal/ptrace: Dont leak unitialized kernel memory with PTRACE_PEEK_SIGINFO Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 062/117] ptrace: restore smp_rmb() in __ptrace_may_access() Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 063/117] media: v4l2-ioctl: clear fields in s_parm Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 064/117] i2c: acorn: fix i2c warning Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 065/117] bcache: fix stack corruption by PRECEDING_KEY() Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 066/117] cgroup: Use css_tryget() instead of css_tryget_online() in task_get_css() Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 067/117] ASoC: cs42xx8: Add regcache mask dirty Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 068/117] ASoC: fsl_asrc: Fix the issue about unsupported rate Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 069/117] x86/uaccess, kcov: Disable stack protector Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 070/117] ALSA: seq: Protect in-kernel ioctl calls with mutex Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 071/117] ALSA: seq: Fix race of get-subscription call vs port-delete ioctls Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 072/117] Revert "ALSA: seq: Protect in-kernel ioctl calls with mutex" Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 073/117] Drivers: misc: fix out-of-bounds access in function param_set_kgdbts_var Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 074/117] scsi: lpfc: add check for loss of ndlp when sending RRQ Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 075/117] arm64/mm: Inhibit huge-vmap with ptdump Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 076/117] scsi: bnx2fc: fix incorrect cast to u64 on shift operation Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 077/117] selftests/timers: Add missing fflush(stdout) calls Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 078/117] usbnet: ipheth: fix racing condition Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 079/117] KVM: x86/pmu: do not mask the value that is written to fixed PMUs Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 080/117] KVM: s390: fix memory slot handling for KVM_SET_USER_MEMORY_REGION Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 081/117] drm/vmwgfx: integer underflow in vmw_cmd_dx_set_shader() leading to an invalid read Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 082/117] drm/vmwgfx: NULL pointer dereference from vmw_cmd_dx_view_define() Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 083/117] usb: dwc2: Fix DMA cache alignment issues Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 084/117] USB: Fix chipmunk-like voice when using Logitech C270 for recording audio Greg Kroah-Hartman
2019-06-20 17:56 ` [PATCH 4.9 085/117] USB: usb-storage: Add new ID to ums-realtek Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 086/117] USB: serial: pl2303: add Allied Telesis VT-Kit3 Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 087/117] USB: serial: option: add support for Simcom SIM7500/SIM7600 RNDIS mode Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 088/117] USB: serial: option: add Telit 0x1260 and 0x1261 compositions Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 089/117] rtc: pcf8523: dont return invalid date when battery is low Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 090/117] ax25: fix inconsistent lock state in ax25_destroy_timer Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 091/117] be2net: Fix number of Rx queues used for flow hashing Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 092/117] ipv6: flowlabel: fl6_sock_lookup() must use atomic_inc_not_zero Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 093/117] lapb: fixed leak of control-blocks Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 094/117] neigh: fix use-after-free read in pneigh_get_next Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 095/117] sunhv: Fix device naming inconsistency between sunhv_console and sunhv_reg Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 096/117] Revert "staging: vc04_services: prevent integer overflow in create_pagelist()" Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 097/117] perf/x86/intel/ds: Fix EVENT vs. UEVENT PEBS constraints Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 098/117] selftests: netfilter: missing error check when setting up veth interface Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 099/117] mISDN: make sure device name is NUL terminated Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 100/117] x86/CPU/AMD: Dont force the CPB cap when running under a hypervisor Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 101/117] perf/ring_buffer: Fix exposing a temporarily decreased data_head Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 102/117] perf/ring_buffer: Add ordering to rb->nest increment Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 103/117] gpio: fix gpio-adp5588 build errors Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 104/117] net: tulip: de4x5: Drop redundant MODULE_DEVICE_TABLE() Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 105/117] i2c: dev: fix potential memory leak in i2cdev_ioctl_rdwr Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 106/117] configfs: Fix use-after-free when accessing sd->s_dentry Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 107/117] perf data: Fix strncat may truncate build failure with recent gcc Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 108/117] perf record: Fix s390 missing module symbol and warning for non-root users Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 109/117] ia64: fix build errors by exporting paddr_to_nid() Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 110/117] KVM: PPC: Book3S: Use new mutex to synchronize access to rtas token list Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 111/117] KVM: PPC: Book3S HV: Dont take kvm->lock around kvm_for_each_vcpu Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 112/117] net: sh_eth: fix mdio access in sh_eth_close() for R-Car Gen2 and RZ/A1 SoCs Greg Kroah-Hartman
2019-06-20 17:57 ` Greg Kroah-Hartman [this message]
2019-06-20 17:57 ` [PATCH 4.9 114/117] scsi: smartpqi: properly set both the DMA mask and the coherent DMA mask Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 115/117] scsi: libsas: delete sas port if expander discover failed Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 116/117] mlxsw: spectrum: Prevent force of 56G Greg Kroah-Hartman
2019-06-20 17:57 ` [PATCH 4.9 117/117] Abort file_remove_privs() for non-reg. files Greg Kroah-Hartman
2019-06-20 22:31 ` [PATCH 4.9 000/117] 4.9.183-stable review kernelci.org bot
2019-06-21  2:18 ` Naresh Kamboju
2019-06-22  0:44 ` Guenter Roeck

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=20190620174358.274189329@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=varun@chelsio.com \
    /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).