From: Sasha Levin <sashal@kernel.org> To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Pan Bian <bianpan2016@163.com>, Boris Brezillon <boris.brezillon@bootlin.com>, Richard Weinberger <richard@nod.at>, Sasha Levin <sashal@kernel.org>, linux-mtd@lists.infradead.org Subject: [PATCH AUTOSEL 4.9 17/91] ubi: Do not drop UBI device reference before using Date: Fri, 22 Nov 2019 01:00:15 -0500 [thread overview] Message-ID: <20191122060129.4239-16-sashal@kernel.org> (raw) In-Reply-To: <20191122060129.4239-1-sashal@kernel.org> From: Pan Bian <bianpan2016@163.com> [ Upstream commit e542087701f09418702673631a908429feb3eae0 ] The UBI device reference is dropped but then the device is used as a parameter of ubi_err. The bug is introduced in changing ubi_err's behavior. The old ubi_err does not require a UBI device as its first parameter, but the new one does. Fixes: 32608703310 ("UBI: Extend UBI layer debug/messaging capabilities") Signed-off-by: Pan Bian <bianpan2016@163.com> Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Sasha Levin <sashal@kernel.org> --- drivers/mtd/ubi/kapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c index 88b1897aeb40f..7826f7c4ec2fb 100644 --- a/drivers/mtd/ubi/kapi.c +++ b/drivers/mtd/ubi/kapi.c @@ -227,9 +227,9 @@ struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode) out_free: kfree(desc); out_put_ubi: - ubi_put_device(ubi); ubi_err(ubi, "cannot open device %d, volume %d, error %d", ubi_num, vol_id, err); + ubi_put_device(ubi); return ERR_PTR(err); } EXPORT_SYMBOL_GPL(ubi_open_volume); -- 2.20.1
WARNING: multiple messages have this Message-ID (diff)
From: Sasha Levin <sashal@kernel.org> To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sasha Levin <sashal@kernel.org>, Boris Brezillon <boris.brezillon@bootlin.com>, Pan Bian <bianpan2016@163.com>, linux-mtd@lists.infradead.org, Richard Weinberger <richard@nod.at> Subject: [PATCH AUTOSEL 4.9 17/91] ubi: Do not drop UBI device reference before using Date: Fri, 22 Nov 2019 01:00:15 -0500 [thread overview] Message-ID: <20191122060129.4239-16-sashal@kernel.org> (raw) In-Reply-To: <20191122060129.4239-1-sashal@kernel.org> From: Pan Bian <bianpan2016@163.com> [ Upstream commit e542087701f09418702673631a908429feb3eae0 ] The UBI device reference is dropped but then the device is used as a parameter of ubi_err. The bug is introduced in changing ubi_err's behavior. The old ubi_err does not require a UBI device as its first parameter, but the new one does. Fixes: 32608703310 ("UBI: Extend UBI layer debug/messaging capabilities") Signed-off-by: Pan Bian <bianpan2016@163.com> Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Sasha Levin <sashal@kernel.org> --- drivers/mtd/ubi/kapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c index 88b1897aeb40f..7826f7c4ec2fb 100644 --- a/drivers/mtd/ubi/kapi.c +++ b/drivers/mtd/ubi/kapi.c @@ -227,9 +227,9 @@ struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode) out_free: kfree(desc); out_put_ubi: - ubi_put_device(ubi); ubi_err(ubi, "cannot open device %d, volume %d, error %d", ubi_num, vol_id, err); + ubi_put_device(ubi); return ERR_PTR(err); } EXPORT_SYMBOL_GPL(ubi_open_volume); -- 2.20.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2019-11-22 6:08 UTC|newest] Thread overview: 118+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-11-22 6:00 [PATCH AUTOSEL 4.9 01/91] scsi: lpfc: Fix dif and first burst use in write commands Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 03/91] ARM: dts: imx53-voipac-dmm-668: Fix memory node duplication Sasha Levin 2019-11-22 6:00 ` Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 04/91] parisc: Fix serio address output Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 05/91] parisc: Fix HP SDC hpa " Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 06/91] arm64: mm: Prevent mismatched 52-bit VA support Sasha Levin 2019-11-22 6:00 ` Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 07/91] arm64: smp: Handle errors reported by the firmware Sasha Levin 2019-11-22 6:00 ` Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 08/91] PM / AVS: SmartReflex: NULL check before some freeing functions is not needed Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 09/91] ARM: ks8695: fix section mismatch warning Sasha Levin 2019-11-22 6:00 ` Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 10/91] ACPI / LPSS: Ignore acpi_device_fix_up_power() return value Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 11/91] crypto: user - support incremental algorithm dumps Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 12/91] mwifiex: fix potential NULL dereference and use after free Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 13/91] mwifiex: debugfs: correct histogram spacing, formatting Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 14/91] rtl818x: fix potential use after free Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 15/91] xfs: require both realtime inodes to mount Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 16/91] ubi: Put MTD device after it is not used Sasha Levin 2019-11-22 6:00 ` Sasha Levin 2019-11-22 6:00 ` Sasha Levin [this message] 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 17/91] ubi: Do not drop UBI device reference before using Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 18/91] microblaze: adjust the help to the real behavior Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 19/91] microblaze: move "... is ready" messages to arch/microblaze/Makefile Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 20/91] gpiolib: Fix return value of gpio_to_desc() stub if !GPIOLIB Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 21/91] VSOCK: bind to random port for VMADDR_PORT_ANY Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 22/91] mtd: rawnand: sunxi: Write pageprog related opcodes to WCMD_SET Sasha Levin 2019-11-22 6:00 ` Sasha Levin 2019-11-22 6:00 ` Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 23/91] btrfs: only track ref_heads in delayed_ref_updates Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 24/91] HID: intel-ish-hid: fixes incorrect error handling Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 25/91] xen/pciback: Check dev_data before using it Sasha Levin 2019-11-22 6:00 ` [Xen-devel] " Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 26/91] pinctrl: xway: fix gpio-hog related boot issues Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 27/91] net/mlx5: Continue driver initialization despite debugfs failure Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 28/91] KVM: s390: unregister debug feature on failing arch init Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 29/91] pinctrl: sh-pfc: sh7264: Fix PFCR3 and PFCR0 register configuration Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 30/91] pinctrl: sh-pfc: sh7734: Fix shifted values in IPSR10 Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 31/91] HID: doc: fix wrong data structure reference for UHID_OUTPUT Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 32/91] dm flakey: Properly corrupt multi-page bios Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 33/91] gfs2: take jdata unstuff into account in do_grow Sasha Levin 2019-11-22 6:00 ` [Cluster-devel] " Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 34/91] xfs: Align compat attrlist_by_handle with native implementation Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 35/91] xfs: Fix bulkstat compat ioctls on x32 userspace Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 36/91] IB/qib: Fix an error code in qib_sdma_verbs_send() Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 37/91] powerpc/book3s/32: fix number of bats in p/v_block_mapped() Sasha Levin 2019-11-22 6:00 ` Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 38/91] powerpc/xmon: fix dump_segments() Sasha Levin 2019-11-22 6:00 ` Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 39/91] drivers/regulator: fix a missing check of return value Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 40/91] serial: max310x: Fix tx_empty() callback Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 41/91] openrisc: Fix broken paths to arch/or32 Sasha Levin 2019-11-22 6:00 ` [OpenRISC] " Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 42/91] RDMA/srp: Propagate ib_post_send() failures to the SCSI mid-layer Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 43/91] scsi: qla2xxx: deadlock by configfs_depend_item Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 44/91] scsi: csiostor: fix incorrect dma device in case of vport Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 45/91] ath6kl: Only use match sets when firmware supports it Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 46/91] ath6kl: Fix off by one error in scan completion Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 47/91] powerpc/prom: fix early DEBUG messages Sasha Levin 2019-11-22 6:00 ` Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 48/91] powerpc/mm: Make NULL pointer deferences explicit on bad page faults Sasha Levin 2019-11-22 6:00 ` Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 49/91] powerpc/44x/bamboo: Fix PCI range Sasha Levin 2019-11-22 6:00 ` Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 50/91] vfio/spapr_tce: Get rid of possible infinite loop Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 51/91] powerpc/powernv/eeh/npu: Fix uninitialized variables in opal_pci_eeh_freeze_status Sasha Levin 2019-11-22 6:00 ` Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 52/91] drbd: ignore "all zero" peer volume sizes in handshake Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 53/91] drbd: reject attach of unsuitable uuids even if connected Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 54/91] drbd: do not block when adjusting "disk-options" while IO is frozen Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 55/91] drbd: fix print_st_err()'s prototype to match the definition Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 56/91] regulator: tps65910: fix a missing check of return value Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 57/91] powerpc/83xx: handle machine check caused by watchdog timer Sasha Levin 2019-11-22 6:00 ` Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 58/91] powerpc/pseries: Fix node leak in update_lmb_associativity_index() Sasha Levin 2019-11-22 6:00 ` Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 59/91] crypto: mxc-scc - fix build warnings on ARM64 Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 60/91] pwm: clps711x: Fix period calculation Sasha Levin 2019-11-22 6:00 ` Sasha Levin 2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 61/91] net/net_namespace: Check the return value of register_pernet_subsys() Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 62/91] um: Make GCOV depend on !KCOV Sasha Levin 2019-11-22 6:01 ` Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 63/91] net: stmicro: fix a missing check of clk_prepare Sasha Levin 2019-11-22 6:01 ` Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 64/91] net: dsa: bcm_sf2: Propagate error value from mdio_write Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 65/91] atl1e: checking the status of atl1e_write_phy_reg Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 66/91] tipc: fix a missing check of genlmsg_put Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 67/91] net/wan/fsl_ucc_hdlc: Avoid double free in ucc_hdlc_probe() Sasha Levin 2019-11-22 6:01 ` Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 68/91] ocfs2: clear journal dirty flag after shutdown journal Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 69/91] vmscan: return NODE_RECLAIM_NOSCAN in node_reclaim() when CONFIG_NUMA is n Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 70/91] lib/genalloc.c: fix allocation of aligned buffer from non-aligned chunk Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 71/91] lib/genalloc.c: use vzalloc_node() to allocate the bitmap Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 72/91] drivers/base/platform.c: kmemleak ignore a known leak Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 73/91] lib/genalloc.c: include vmalloc.h Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 74/91] mtd: Check add_mtd_device() ret code Sasha Levin 2019-11-22 6:01 ` Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 75/91] tipc: fix memory leak in tipc_nl_compat_publ_dump Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 76/91] net/core/neighbour: tell kmemleak about hash tables Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 77/91] net/core/neighbour: fix kmemleak minimal reference count for " Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 78/91] sfc: suppress duplicate nvmem partition types in efx_ef10_mtd_probe Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 79/91] ip_tunnel: Make none-tunnel-dst tunnel port work with lwtunnel Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 80/91] decnet: fix DN_IFREQ_SIZE Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 81/91] tipc: fix skb may be leaky in tipc_link_input Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 82/91] sfc: initialise found bitmap in efx_ef10_mtd_probe Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 83/91] net: fix possible overflow in __sk_mem_raise_allocated() Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 84/91] sctp: don't compare hb_timer expire date before starting it Sasha Levin 2019-11-22 6:01 ` Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 85/91] net: dev: Use unsigned integer as an argument to left-shift Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 86/91] iommu/amd: Fix NULL dereference bug in match_hid_uid Sasha Levin 2019-11-22 6:01 ` Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 87/91] scsi: libsas: Support SATA PHY connection rate unmatch fixing during discovery Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 88/91] ACPI / APEI: Switch estatus pool to use vmalloc memory Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 89/91] scsi: libsas: Check SMP PHY control function result Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 90/91] powerpc/pseries/dlpar: Fix a missing check in dlpar_parse_cc_property() Sasha Levin 2019-11-22 6:01 ` Sasha Levin 2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 91/91] mtd: Remove a debug trace in mtdpart.c Sasha Levin 2019-11-22 6:01 ` 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=20191122060129.4239-16-sashal@kernel.org \ --to=sashal@kernel.org \ --cc=bianpan2016@163.com \ --cc=boris.brezillon@bootlin.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mtd@lists.infradead.org \ --cc=richard@nod.at \ --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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.