All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@denx.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Pavel Machek <pavel@denx.de>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Stephen Boyd <swboyd@chromium.org>,
	Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>,
	Rob Clark <robdclark@gmail.com>,
	Sean Paul <seanpaul@chromium.org>,
	Douglas Anderson <dianders@chromium.org>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH] drm/msm: fix leaks if initialization fails
Date: Mon, 9 Mar 2020 11:14:10 +0100	[thread overview]
Message-ID: <20200309101410.GA18031@duo.ucw.cz> (raw)
In-Reply-To: <20200304171817.GC1852712@kroah.com>

[-- Attachment #1: Type: text/plain, Size: 943 bytes --]

We should free resources in unlikely case of allocation failure.
    
Signed-off-by: Pavel Machek <pavel@denx.de>

---

> Can you submit a patch to fix it?

Here it is.

Best regards,
								Pavel


diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 83a0000eecb3..f5c1495cc4b9 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -444,8 +444,10 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
 	if (!dev->dma_parms) {
 		dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms),
 					      GFP_KERNEL);
-		if (!dev->dma_parms)
-			return -ENOMEM;
+		if (!dev->dma_parms) {
+			ret = -ENOMEM;
+			goto err_msm_uninit;
+		}
 	}
 	dma_set_max_seg_size(dev, DMA_BIT_MASK(32));
 


-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2020-03-09 10:14 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-03 17:42 [PATCH 4.19 00/87] 4.19.108-stable review Greg Kroah-Hartman
2020-03-03 17:42 ` [PATCH 4.19 01/87] irqchip/gic-v3-its: Fix misuse of GENMASK macro Greg Kroah-Hartman
2020-03-03 17:42 ` [PATCH 4.19 02/87] iwlwifi: pcie: fix rb_allocator workqueue allocation Greg Kroah-Hartman
2020-03-03 17:42 ` [PATCH 4.19 03/87] ipmi:ssif: Handle a possible NULL pointer reference Greg Kroah-Hartman
2020-03-03 17:42 ` [PATCH 4.19 04/87] drm/msm: Set dma maximum segment size for mdss Greg Kroah-Hartman
2020-03-04 15:13   ` Pavel Machek
2020-03-04 17:18     ` Greg Kroah-Hartman
2020-03-09 10:14       ` Pavel Machek [this message]
2020-03-10 21:03         ` [PATCH] drm/msm: fix leaks if initialization fails Doug Anderson
2020-03-03 17:42 ` [PATCH 4.19 05/87] sched/core: Dont skip remote tick for idle CPUs Greg Kroah-Hartman
2020-03-04 15:15   ` Pavel Machek
2020-03-04 17:17     ` Greg Kroah-Hartman
2020-03-03 17:42 ` [PATCH 4.19 06/87] dax: pass NOWAIT flag to iomap_apply Greg Kroah-Hartman
2020-03-03 17:42 ` [PATCH 4.19 07/87] mac80211: consider more elements in parsing CRC Greg Kroah-Hartman
2020-03-03 17:42 ` [PATCH 4.19 08/87] cfg80211: check wiphy driver existence for drvinfo report Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 09/87] s390/zcrypt: fix card and queue total counter wrap Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 10/87] qmi_wwan: re-add DW5821e pre-production variant Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 11/87] qmi_wwan: unconditionally reject 2 ep interfaces Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 12/87] arm/ftrace: Fix BE text poking Greg Kroah-Hartman
2020-03-05 13:49   ` Pavel Machek
2020-03-05 14:53     ` Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 13/87] ARM: dts: sti: fixup sound frame-inversion for stihxxx-b2120.dtsi Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 14/87] soc/tegra: fuse: Fix build with Tegra194 configuration Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 15/87] net: ena: fix potential crash when rxfh key is NULL Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 16/87] net: ena: fix uses of round_jiffies() Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 17/87] net: ena: add missing ethtool TX timestamping indication Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 18/87] net: ena: fix incorrect default RSS key Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 19/87] net: ena: rss: fix failure to get indirection table Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 20/87] net: ena: rss: store hash function as values and not bits Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 21/87] net: ena: fix incorrectly saving queue numbers when setting RSS indirection table Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 22/87] net: ena: ethtool: use correct value for crc32 hash Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 23/87] net: ena: ena-com.c: prevent NULL pointer dereference Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 24/87] cifs: Fix mode output in debugging statements Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 25/87] bcache: ignore pending signals when creating gc and allocator thread Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 26/87] cfg80211: add missing policy for NL80211_ATTR_STATUS_CODE Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 27/87] sysrq: Restore original console_loglevel when sysrq disabled Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 28/87] sysrq: Remove duplicated sysrq message Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 29/87] net: fib_rules: Correctly set table field when table number exceeds 8 bits Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 30/87] net: mscc: fix in frame extraction Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 31/87] net: phy: restore mdio regs in the iproc mdio driver Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 32/87] net: sched: correct flower port blocking Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 33/87] nfc: pn544: Fix occasional HW initialization failure Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 34/87] sctp: move the format error check out of __sctp_sf_do_9_1_abort Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 35/87] ipv6: Fix route replacement with dev-only route Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 36/87] ipv6: Fix nlmsg_flags when splitting a multipath route Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 37/87] qede: Fix race between rdma destroy workqueue and link change event Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 38/87] net/tls: Fix to avoid gettig invalid tls record Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 39/87] ext4: potential crash on allocation error in ext4_alloc_flex_bg_array() Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 40/87] audit: fix error handling in audit_data_to_entry() Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 41/87] ACPICA: Introduce ACPI_ACCESS_BYTE_WIDTH() macro Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 42/87] ACPI: watchdog: Fix gas->access_width usage Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 43/87] KVM: VMX: check descriptor table exits on instruction emulation Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 44/87] HID: ite: Only bind to keyboard USB interface on Acer SW5-012 keyboard dock Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 45/87] HID: core: fix off-by-one memset in hid_report_raw_event() Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 46/87] HID: core: increase HID report buffer size to 8KiB Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 47/87] macintosh: therm_windtunnel: fix regression when instantiating devices Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 48/87] tracing: Disable trace_printk() on post poned tests Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 49/87] Revert "PM / devfreq: Modify the device name as devfreq(X) for sysfs" Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 50/87] amdgpu/gmc_v9: save/restore sdpif regs during S3 Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 51/87] vhost: Check docket sk_family instead of call getname Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 52/87] HID: alps: Fix an error handling path in alps_input_configured() Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 53/87] HID: hiddev: Fix race in in hiddev_disconnect() Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 54/87] MIPS: VPE: Fix a double free and a memory leak in release_vpe() Greg Kroah-Hartman
2020-03-03 17:43   ` Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 55/87] i2c: altera: Fix potential integer overflow Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 56/87] i2c: jz4780: silence log flood on txabrt Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 57/87] drm/i915/gvt: Fix orphan vgpu dmabuf_objs lifetime Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 58/87] drm/i915/gvt: Separate display reset from ALL_ENGINES reset Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 59/87] hv_netvsc: Fix unwanted wakeup in netvsc_attach() Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 60/87] usb: charger: assign specific number for enum value Greg Kroah-Hartman
2020-03-04 17:27   ` Pavel Machek
2020-03-04 17:39     ` Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 61/87] s390/qeth: vnicc Fix EOPNOTSUPP precedence Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 62/87] net: netlink: cap max groups which will be considered in netlink_bind() Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 63/87] net: atlantic: fix use after free kasan warn Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 64/87] net: atlantic: fix potential error handling Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 65/87] net/smc: no peer ID in CLC decline for SMCD Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 66/87] net: ena: make ena rxfh support ETH_RSS_HASH_NO_CHANGE Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 67/87] namei: only return -ECHILD from follow_dotdot_rcu() Greg Kroah-Hartman
2020-03-03 17:43 ` [PATCH 4.19 68/87] mwifiex: drop most magic numbers from mwifiex_process_tdls_action_frame() Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 69/87] mwifiex: delete unused mwifiex_get_intf_num() Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 70/87] KVM: SVM: Override default MMIO mask if memory encryption is enabled Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 71/87] KVM: Check for a bad hva before dropping into the ghc slow path Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 72/87] sched/fair: Optimize update_blocked_averages() Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 73/87] sched/fair: Fix O(nr_cgroups) in the load balancing path Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 74/87] perf stat: Use perf_evsel__is_clocki() for clock events Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 75/87] perf stat: Fix shadow stats " Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 76/87] drivers: net: xgene: Fix the order of the arguments of alloc_etherdev_mqs() Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 77/87] kprobes: Set unoptimized flag after unoptimizing code Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 78/87] pwm: omap-dmtimer: put_device() after of_find_device_by_node() Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 79/87] perf hists browser: Restore ESC as "Zoom out" of DSO/thread/etc Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 80/87] KVM: x86: Remove spurious kvm_mmu_unload() from vcpu destruction path Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 81/87] KVM: x86: Remove spurious clearing of async #PF MSR Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 82/87] thermal: brcmstb_thermal: Do not use DT coefficients Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 83/87] netfilter: nft_tunnel: no need to call htons() when dumping ports Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 84/87] netfilter: nf_flowtable: fix documentation Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 85/87] padata: always acquire cpu_hotplug_lock before pinst->lock Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 86/87] mm/huge_memory.c: use head to check huge zero page Greg Kroah-Hartman
2020-03-03 17:44 ` [PATCH 4.19 87/87] mm, thp: fix defrag setting if newline is not used Greg Kroah-Hartman
     [not found] ` <20200303174349.075101355-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
2020-03-03 22:10   ` [PATCH 4.19 00/87] 4.19.108-stable review Jon Hunter
2020-03-03 22:10     ` Jon Hunter
2020-03-03 23:18 ` shuah
2020-03-04  7:09 ` Naresh Kamboju
2020-03-04 16:52 ` 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=20200309101410.GA18031@duo.ucw.cz \
    --to=pavel@denx.de \
    --cc=dianders@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robdclark@gmail.com \
    --cc=saiprakash.ranjan@codeaurora.org \
    --cc=sashal@kernel.org \
    --cc=seanpaul@chromium.org \
    --cc=stable@vger.kernel.org \
    --cc=swboyd@chromium.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 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.