From: Ben Hutchings <ben@decadent.org.uk>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: akpm@linux-foundation.org, "Guenter Roeck" <linux@roeck-us.net>,
"Axel Lin" <axel.lin@ingics.com>
Subject: [PATCH 3.2 049/131] hwmon: (gpio-fan) Prevent overflow problem when writing large limits
Date: Thu, 11 Sep 2014 13:32:13 +0100 [thread overview]
Message-ID: <lsq.1410438733.752774590@decadent.org.uk> (raw)
In-Reply-To: <lsq.1410438733.176537304@decadent.org.uk>
3.2.63-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Axel Lin <axel.lin@ingics.com>
commit 2565fb05d1e9fc0831f7b1c083bcfcb1cba1f020 upstream.
On platforms with sizeof(int) < sizeof(unsigned long), writing a rpm value
larger than MAXINT will result in unpredictable limit values written to the
chip. Avoid auto-conversion from unsigned long to int to fix the problem.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
drivers/hwmon/gpio-fan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/hwmon/gpio-fan.c
+++ b/drivers/hwmon/gpio-fan.c
@@ -195,7 +195,7 @@ static int get_fan_speed_index(struct gp
return -EINVAL;
}
-static int rpm_to_speed_index(struct gpio_fan_data *fan_data, int rpm)
+static int rpm_to_speed_index(struct gpio_fan_data *fan_data, unsigned long rpm)
{
struct gpio_fan_speed *speed = fan_data->speed;
int i;
next prev parent reply other threads:[~2014-09-11 12:32 UTC|newest]
Thread overview: 139+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-11 12:32 [PATCH 3.2 000/131] 3.2.63-rc1 review Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 011/131] Bluetooth: never linger on process exit Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 033/131] ext4: cleanup in ext4_discard_allocated_blocks() Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 079/131] MIPS: OCTEON: make get_system_type() thread-safe Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 002/131] ASoC: samsung: Correct I2S DAI suspend/resume ops Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 012/131] scsi: handle flush errors properly Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 018/131] hwmon: (smsc47m192) Fix temperature limit and vrm write operations Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 055/131] hwmon: (lm92) Prevent overflow problem when writing large limits Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 095/131] openrisc: add missing header inclusion Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 096/131] MIPS: perf: Fix build error caused by unused counters_per_cpu_to_total() Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 119/131] sparc64: ldc_connect() should not return EINVAL when handshake is in progress Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 112/131] sparc64: Don't bark so loudly about 32-bit tasks generating 64-bit fault addresses Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 063/131] powerpc: Fix build errors STRICT_MM_TYPECHECKS Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 008/131] [media] gspca_pac7302: Add new usb-id for Genius i-Look 317 Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 069/131] md/raid6: avoid data corruption during recovery of double-degraded RAID6 Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 077/131] xhci: Treat not finding the event_seg on COMP_STOP the same as COMP_STOP_INVAL Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 098/131] openrisc: include export.h for EXPORT_SYMBOL Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 048/131] ALSA: virtuoso: add Xonar Essence STX II support Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 106/131] iovec: make sure the caller actually wants anything in memcpy_fromiovecend Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 090/131] HID: picolcd: sanity check report size in raw_event() callback Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 111/131] sparc64: Fix top-level fault handling bugs Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 078/131] usb: xhci: amd chipset also needs short TX quirk Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 072/131] USB: serial: pl2303: add device id for ztek device Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 118/131] sunsab: Fix detection of BREAK on sunsab serial console Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 013/131] USB: OHCI: don't lose track of EDs when a controller dies Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 117/131] bbc-i2c: Fix BBC I2C envctrl on SunBlade 2000 Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 070/131] USB: option: add VIA Telecom CDS7 chipset device id Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 004/131] stable_kernel_rules: Add pointer to netdev-FAQ for network patches Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 027/131] tpm: Provide a generic means to override the chip returned timeouts Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 038/131] hwmon: (amc6821) Fix possible race condition bug Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 121/131] slab/mempolicy: always use local policy from interrupt context Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 044/131] netlabel: fix a problem when setting bits below the previously lowest bit Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 022/131] hpsa: fix bad -ENOMEM return value in hpsa_big_passthru_ioctl Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 062/131] reiserfs: Fix use after free in journal teardown Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 042/131] ARM: OMAP3: Fix choice of omap3_restore_es function in OMAP34XX rev3.1.2 case Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 056/131] hwmon: (ads1015) Fix out-of-bounds array access Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 020/131] staging: vt6655: Fix disassociated messages every 10 seconds Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 030/131] MIPS: Prevent user from setting FCSR cause bits Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 086/131] ACPI / EC: Add support to disallow QR_EC to be issued when SCI_EVT isn't set Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 122/131] sparc: use asm-generic version of types.h Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 099/131] inetpeer: get rid of ip_id_count Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 051/131] drm/ttm: Fix possible stack overflow by recursive shrinker calls Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 050/131] hwmon: (sis5595) Prevent overflow problem when writing large limits Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 057/131] s390/locking: Reenable optimistic spinning Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 054/131] RDMA/iwcm: Use a default listen backlog if needed Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 120/131] arch/sparc/math-emu/math_32.c: drop stray break operator Ben Hutchings
2014-09-11 12:32 ` Ben Hutchings [this message]
2014-09-11 12:32 ` [PATCH 3.2 091/131] ARM: 8128/1: abort: don't clear the exclusive monitors Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 010/131] x86: don't exclude low BIOS area when allocating address space for non-PCI cards Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 074/131] iommu/amd: Fix cleanup_domain for mass device removal Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 108/131] sparc64: Fix argument sign extension for compat_sys_futex() Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 029/131] MIPS: tlbex: Fix a missing statement for HUGETLB Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 025/131] iommu/vt-d: Exclude devices using RMRRs from IOMMU API domains Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 102/131] tcp: Fix integer-overflow in TCP vegas Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 113/131] sparc64: Fix huge TSB mapping on pre-UltraSPARC-III cpus Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 047/131] ALSA: virtuoso: Xonar DSX support Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 076/131] kvm: iommu: fix the third parameter of kvm_iommu_put_pages (CVE-2014-3601) Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 087/131] USB: sisusb: add device id for Magic Control USB video Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 003/131] block: don't assume last put of shared tags is for the host Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 035/131] hwmon: (lm85) Fix various errors on attribute writes Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 026/131] net: sendmsg: fix NULL pointer dereference Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 014/131] ahci: add support for the Promise FastTrak TX8660 SATA HBA (ahci mode) Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 114/131] sparc64: Add membar to Niagara2 memcpy code Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 085/131] HID: logitech-dj: prevent false errors to be shown Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 060/131] x86/xen: resume timer irqs early Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 041/131] mnt: Change the default remount atime from relatime to the existing value Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 073/131] USB: ftdi_sio: Added PID for new ekey device Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 092/131] ARM: 8129/1: errata: work around Cortex-A15 erratum 830321 using dummy strex Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 023/131] Drivers: scsi: storvsc: Implement a eh_timed_out handler Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 103/131] net: sctp: inherit auth_capable on INIT collisions Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 110/131] sparc64: Handle 32-bit tasks properly in compute_effective_address() Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 005/131] debugfs: Fix corrupted loop in debugfs_remove_recursive Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 016/131] USB: Fix persist resume of some SS USB devices Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 006/131] serial: core: Preserve termios c_cflag for console resume Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 075/131] pata_scc: propagate return value of scc_wait_after_reset Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 058/131] ring-buffer: Up rb_iter_peek() loop count to 3 Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 116/131] sparc64: Guard against flushing openfirmware mappings Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 034/131] ext4: fix ext4_discard_allocated_blocks() if we can't allocate the pa struct Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 028/131] hwmon: (ads1015) Fix off-by-one for valid channel index checking Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 043/131] netlabel: use GFP flags from caller instead of GFP_ATOMIC Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 100/131] ip: make IP identifiers less predictable Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 009/131] mtd/ftl: fix the double free of the buffers allocated in build_maps() Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 017/131] drm/radeon: fix irq ring buffer overflow handling Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 081/131] isofs: Fix unbounded recursion when processing relocated directories Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 084/131] USB: whiteheat: Added bounds checking for bulk command response Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 080/131] xhci: rework cycle bit checking for new dequeue pointers Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 040/131] crypto: af_alg - properly label AF_ALG socket Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 019/131] staging: vt6655: Fix Warning on boot handle_irq_event_percpu Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 001/131] KVM: x86: Inter-privilege level ret emulation is not implemeneted Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 064/131] powerpc/mm: Use read barrier when creating real_pte Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 115/131] sparc64: Do not insert non-valid PTEs into the TSB hash table Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 015/131] usbcore: don't log on consecutive debounce failures of the same port Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 032/131] md/raid1,raid10: always abort recover on write error Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 024/131] Fix gcc-4.9.0 miscompilation of load_balance() in scheduler Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 097/131] MIPS: Fix accessing to per-cpu data when flushing the cache Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 071/131] USB: ftdi_sio: add Basic Micro ATOM Nano USB2Serial PID Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 109/131] sparc64: Make itc_sync_lock raw Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 107/131] sctp: fix possible seqlock seadlock in sctp_packet_transmit() Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 052/131] powerpc/mm/numa: Fix break placement Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 068/131] CIFS: Fix wrong directory attributes after rename Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 039/131] MIPS: GIC: Prevent array overrun Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 083/131] HID: fix a couple of off-by-ones Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 065/131] ASoC: pxa-ssp: drop SNDRV_PCM_FMTBIT_S24_LE Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 101/131] tcp: Fix integer-overflows in TCP veno Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 021/131] bfa: Fix undefined bit shift on big-endian architectures with 32-bit DMA address Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 067/131] ALSA: hda/realtek - Avoid setting wrong COEF on ALC269 & co Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 094/131] USB: serial: fix potential heap buffer overflow Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 053/131] drm/radeon: load the lm63 driver for an lm64 thermal chip Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 105/131] net: Correctly set segment mac_len in skb_segment() Ben Hutchings
2014-09-11 12:48 ` Vlad Yasevich
2014-09-13 22:38 ` Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 059/131] ring-buffer: Always reset iterator to reader page Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 082/131] HID: logitech: perform bounds checking on device_id early enough Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 104/131] macvlan: Initialize vlan_features to turn on offload support Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 007/131] [media] tda10071: force modulation to QPSK on DVB-S Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 046/131] USB: serial: ftdi_sio: Add support for new Xsens devices Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 066/131] Btrfs: fix csum tree corruption, duplicate and outdated checksums Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 089/131] HID: magicmouse: sanity check report size in raw_event() callback Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 037/131] hwmon: (amc6821) Fix return value Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 031/131] mm, thp: do not allow thp faults to avoid cpuset restrictions Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 088/131] NFSv4: Fix problems with close in the presence of a delegation Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 093/131] USB: serial: fix potential stack buffer overflow Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 036/131] hwmon: (lm78) Fix overflow problems seen when writing large temperature limits Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 061/131] carl9170: fix sending URBs with wrong type when using full-speed Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 045/131] USB: serial: ftdi_sio: Annotate the current Xsens PID assignments Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 129/131] x86_64/entry/xen: Do not invoke espfix64 on Xen Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 126/131] x86, espfix: Fix broken header guard Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 127/131] x86, espfix: Make espfix64 a Kconfig option, fix UML Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 130/131] x86/espfix/xen: Fix allocation of pages for paravirt page tables Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 131/131] microblaze: Fix makefile to work with latest toolchain Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 124/131] x86-64, espfix: Don't leak bits 31:16 of %esp returning to 16-bit stack Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 125/131] x86, espfix: Move espfix definitions into a separate header file Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 128/131] x86, espfix: Make it possible to disable 16-bit support Ben Hutchings
2014-09-11 12:32 ` [PATCH 3.2 123/131] Revert "x86-64, modify_ldt: Make support for 16-bit segments a runtime option" Ben Hutchings
2014-09-11 13:30 ` [PATCH 3.2 000/131] 3.2.63-rc1 review Guenter Roeck
2014-09-12 11:59 ` Satoru Takeuchi
2014-09-13 22:39 ` Ben Hutchings
2014-09-13 22:39 ` Ben Hutchings
2014-09-11 23:13 ` Ben Hutchings
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=lsq.1410438733.752774590@decadent.org.uk \
--to=ben@decadent.org.uk \
--cc=akpm@linux-foundation.org \
--cc=axel.lin@ingics.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--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).