From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Hans Verkuil <hans.verkuil@cisco.com>,
Mauro Carvalho Chehab <mchehab@s-opensource.com>
Subject: [PATCH 4.11 51/78] [media] pvrusb2: reduce stack usage pvr2_eeprom_analyze()
Date: Mon, 19 Jun 2017 23:15:51 +0800 [thread overview]
Message-ID: <20170619151031.353651539@linuxfoundation.org> (raw)
In-Reply-To: <20170619151029.408399976@linuxfoundation.org>
4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <arnd@arndb.de>
commit 6830733d53a4517588e56227b9c8538633f0c496 upstream.
The driver uses a relatively large data structure on the stack, which
showed up on my radar as we get a warning with the "latent entropy"
GCC plugin:
drivers/media/usb/pvrusb2/pvrusb2-eeprom.c:153:1: error: the frame size of 1376 bytes is larger than 1152 bytes [-Werror=frame-larger-than=]
The warning is usually hidden as we raise the warning limit to 2048
when the plugin is enabled, but I'd like to lower that again in the
future, and making this function smaller helps to do that without
build regressions.
Further analysis shows that putting an 'i2c_client' structure on
the stack is not really supported, as the embedded 'struct device'
is not initialized here, and we are only saved by the fact that
the function that is called here does not use the pointer at all.
Fixes: d855497edbfb ("V4L/DVB (4228a): pvrusb2 to kernel 2.6.18")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/media/usb/pvrusb2/pvrusb2-eeprom.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
--- a/drivers/media/usb/pvrusb2/pvrusb2-eeprom.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-eeprom.c
@@ -118,15 +118,10 @@ int pvr2_eeprom_analyze(struct pvr2_hdw
memset(&tvdata,0,sizeof(tvdata));
eeprom = pvr2_eeprom_fetch(hdw);
- if (!eeprom) return -EINVAL;
+ if (!eeprom)
+ return -EINVAL;
- {
- struct i2c_client fake_client;
- /* Newer version expects a useless client interface */
- fake_client.addr = hdw->eeprom_addr;
- fake_client.adapter = &hdw->i2c_adap;
- tveeprom_hauppauge_analog(&fake_client,&tvdata,eeprom);
- }
+ tveeprom_hauppauge_analog(NULL, &tvdata, eeprom);
trace_eeprom("eeprom assumed v4l tveeprom module");
trace_eeprom("eeprom direct call results:");
next prev parent reply other threads:[~2017-06-19 15:18 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-19 15:15 [PATCH 4.11 00/78] 4.11.7-stable review Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 01/78] fs: pass on flags in compat_writev Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 02/78] configfs: Fix race between create_link and configfs_rmdir Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 03/78] can: gs_usb: fix memory leak in gs_cmd_reset() Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 04/78] ila_xlat: add missing hash secret initialization Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 06/78] [media] vb2: Fix an off by one error in vb2_plane_vaddr Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 07/78] [media] cec: race fix: dont return -ENONET in cec_receive() Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 08/78] selinux: fix double free in selinux_parse_opts_str() Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 09/78] mac80211: dont look at the PM bit of BAR frames Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 10/78] mac80211/wpa: use constant time memory comparison for MACs Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 11/78] drm: mxsfb_crtc: Reset the eLCDIF controller Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 12/78] drm/amdgpu: Fix overflow of watermark calcs at > 4k resolutions Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 13/78] drm/i915: Fix GVT-g PVINFO version compatibility check Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 15/78] drm/i915: Do not sync RCU during shrinking Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 16/78] mac80211: fix IBSS presp allocation size Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 17/78] mac80211: strictly check mesh address extension mode Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 18/78] mac80211: fix dropped counter in multiqueue RX Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 19/78] mac80211: dont send SMPS action frame in AP mode when not needed Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 20/78] drm/mediatek: fix mtk_hdmi_setup_vendor_specific_infoframe mistake Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 21/78] drm/vc4: Fix OOPSes from trying to cache a partially constructed BO Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 23/78] serial: 8250_lpss: Unconditionally set PCI master for Quark Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 24/78] serial: sh-sci: Fix (AUTO)RTS in sci_init_pins() Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 25/78] serial: sh-sci: Fix late enablement of AUTORTS Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 26/78] x86/mm/32: Set the __vmalloc_start_set flag in initmem_init() Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 27/78] mfd: omap-usb-tll: Fix inverted bit use for USB TLL mode Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 28/78] mfd: axp20x: Add support for dts property "xpowers,master-mode" Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 29/78] dt-bindings: mfd: axp20x: Add "xpowers,master-mode" property for AXP806 PMICs Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 30/78] mfd: cpcap: Fix interrupt to use level interrupt Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 31/78] mfd: cpcap: Use ack_invert interrupts Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 32/78] mfd: cpcap: Fix bad use of IRQ sense register Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 33/78] phy: rcar-gen3-usb2: fix implementation for runtime PM Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 34/78] mtd: physmap_of: really fix the physmap add-ons Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 35/78] powerpc/mm: Add physical address to Linux page table dump Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 36/78] staging: rtl8188eu: prevent an underflow in rtw_check_beacon_data() Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 37/78] staging: bcm2835-camera: fix error handling in init Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 38/78] staging: iio: tsl2x7x_core: Fix standard deviation calculation Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 39/78] iio: imu: st_lsm6dsx: do not apply ODR configuration in write_raw handler Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 40/78] iio: proximity: as3935: recalibrate RCO after resume Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 41/78] iio: adc: ti_am335x_adc: allocating too much in probe Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 42/78] ALSA: hda: Add Geminilake id to SKL_PLUS Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 43/78] ALSA: usb-audio: fix Amanero Combo384 quirk on big-endian hosts Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 44/78] usb: gadget: udc: renesas_usb3: fix pm_runtime functions calling Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 45/78] usb: gadget: udc: renesas_usb3: fix deadlock by spinlock Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 46/78] usb: gadget: udc: renesas_usb3: lock for PN_ registers access Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 47/78] USB: hub: fix SS max number of ports Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 48/78] usb: core: fix potential memory leak in error path during hcd creation Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 49/78] USB: usbip: fix nonconforming hub descriptor Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 50/78] usb: dwc3: gadget: Fix ISO transfer performance Greg Kroah-Hartman
2017-06-19 15:15 ` Greg Kroah-Hartman [this message]
2017-06-19 15:15 ` [PATCH 4.11 52/78] USB: gadget: dummy_hcd: fix hub-descriptor removable fields Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 53/78] usb: r8a66597-hcd: select a different endpoint on timeout Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 54/78] usb: r8a66597-hcd: decrease timeout Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 55/78] [media] coda: restore original firmware locations Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 56/78] drivers/misc/c2port/c2port-duramar2150.c: checking for NULL instead of IS_ERR() Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 57/78] usb: xhci: Fix USB 3.1 supported protocol parsing Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 58/78] usb: xhci: ASMedia ASM1042A chipset need shorts TX quirk Greg Kroah-Hartman
2017-06-19 15:15 ` [PATCH 4.11 59/78] USB: gadget: fix GPF in gadgetfs Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 60/78] USB: gadgetfs, dummy-hcd, net2280: fix locking for callbacks Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 61/78] mm/memory-failure.c: use compound_head() flags for huge pages Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 62/78] swap: cond_resched in swap_cgroup_prepare() Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 63/78] mm: numa: avoid waiting on freed migrated pages Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 64/78] userfaultfd: shmem: handle coredumping in handle_userfault() Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 65/78] iio: imu: inv_mpu6050: add accel lpf setting for chip >= MPU6500 Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 66/78] staging: iio: ad7152: Fix deadlock in ad7152_write_raw_samp_freq() Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 67/78] iio: adc: meson-saradc: fix potential crash in meson_sar_adc_clear_fifo Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 68/78] sched/core: Idle_task_exit() shouldnt use switch_mm_irqs_off() Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 69/78] genirq: Release resources in __setup_irq() error path Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 70/78] alarmtimer: Prevent overflow of relative timers Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 71/78] alarmtimer: Rate limit periodic intervals Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 72/78] virtio_balloon: disable VIOMMU support Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 73/78] MIPS: Fix bnezc/jialc return address calculation Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 74/78] MIPS: .its targets depend on vmlinux Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 75/78] crypto: Work around deallocated stack frame reference gcc bug on sparc Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 76/78] ARM: dts: am335x-sl50: Fix card detect pin for mmc1 Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 77/78] ARM: dts: am335x-sl50: Fix cannot claim requested pins for spi0 Greg Kroah-Hartman
2017-06-19 15:16 ` [PATCH 4.11 78/78] mm: larger stack guard gap, between vmas Greg Kroah-Hartman
2017-06-19 22:48 ` [PATCH 4.11 00/78] 4.11.7-stable review Guenter Roeck
2017-06-20 0:54 ` Greg Kroah-Hartman
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=20170619151031.353651539@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=hans.verkuil@cisco.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@s-opensource.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