summaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorSrinivasarao P <spathi@codeaurora.org>2018-08-07 15:36:11 +0530
committerSrinivasarao P <spathi@codeaurora.org>2018-08-07 15:36:56 +0530
commitb2c952f9a899b7ec78c417951a950f08c5aa9e3a (patch)
tree8953df41df5bb1284c87bd31db104868ca54017f /drivers/pci
parent499dddad34fa922f92339b98ff7f31b21be69893 (diff)
parent139622602304abdded7433a218d8a499822c7c19 (diff)
Merge android-4.4.146 (13962260) into msm-4.4
* refs/heads/tmp-13962260 Linux 4.4.146 scsi: sg: fix minor memory leak in error path crypto: padlock-aes - Fix Nano workaround data corruption kvm: x86: vmx: fix vpid leak virtio_balloon: fix another race between migration and ballooning net: socket: fix potential spectre v1 gadget in socketcall can: ems_usb: Fix memory leak on ems_usb_disconnect() squashfs: more metadata hardenings squashfs: more metadata hardening netlink: Fix spectre v1 gadget in netlink_create() net: dsa: Do not suspend/resume closed slave_dev inet: frag: enforce memory limits earlier tcp: add one more quick ack after after ECN events tcp: refactor tcp_ecn_check_ce to remove sk type cast tcp: do not aggressively quick ack after ECN events tcp: add max_quickacks param to tcp_incr_quickack and tcp_enter_quickack_mode tcp: do not force quickack when receiving out-of-order packets NET: stmmac: align DMA stuff to largest cache line length xen-netfront: wait xenbus state change when load module manually net: lan78xx: fix rx handling before first packet is send net: fix amd-xgbe flow-control issue ipv4: remove BUG_ON() from fib_compute_spec_dst ASoC: pxa: Fix module autoload for platform drivers dmaengine: pxa_dma: remove duplicate const qualifier ext4: check for allocation block validity with block group locked ext4: fix inline data updates with checksums enabled squashfs: be more careful about metadata corruption random: mix rdrand with entropy sent in from userspace drm: Add DP PSR2 sink enable bit media: si470x: fix __be16 annotations scsi: megaraid_sas: Increase timeout by 1 sec for non-RAID fastpath IOs scsi: scsi_dh: replace too broad "TP9" string with the exact models media: omap3isp: fix unbalanced dma_iommu_mapping crypto: authenc - don't leak pointers to authenc keys crypto: authencesn - don't leak pointers to authenc keys usb: hub: Don't wait for connect state at resume for powered-off ports microblaze: Fix simpleImage format generation audit: allow not equal op for audit by executable rsi: Fix 'invalid vdd' warning in mmc ipconfig: Correctly initialise ic_nameservers drm/gma500: fix psb_intel_lvds_mode_valid()'s return type memory: tegra: Apply interrupts mask per SoC memory: tegra: Do not handle spurious interrupts ALSA: hda/ca0132: fix build failure when a local macro is defined drm/atomic: Handling the case when setting old crtc for plane media: siano: get rid of __le32/__le16 cast warnings bpf: fix references to free_bpf_prog_info() in comments thermal: exynos: fix setting rising_threshold for Exynos5433 scsi: megaraid: silence a static checker bug scsi: 3w-xxxx: fix a missing-check bug scsi: 3w-9xxx: fix a missing-check bug perf: fix invalid bit in diagnostic entry s390/cpum_sf: Add data entry sizes to sampling trailer entry brcmfmac: Add support for bcm43364 wireless chipset mtd: rawnand: fsl_ifc: fix FSL NAND driver to read all ONFI parameter pages media: saa7164: Fix driver name in debug output libata: Fix command retry decision media: rcar_jpu: Add missing clk_disable_unprepare() on error in jpu_open() dma-iommu: Fix compilation when !CONFIG_IOMMU_DMA tty: Fix data race in tty_insert_flip_string_fixed_flag HID: i2c-hid: check if device is there before really probing powerpc/embedded6xx/hlwd-pic: Prevent interrupts from being handled by Starlet drm/radeon: fix mode_valid's return type HID: hid-plantronics: Re-resend Update to map button for PTT products ALSA: usb-audio: Apply rate limit to warning messages in URB complete callback media: smiapp: fix timeout checking in smiapp_read_nvm md: fix NULL dereference of mddev->pers in remove_and_add_spares() regulator: pfuze100: add .is_enable() for pfuze100_swb_regulator_ops ALSA: emu10k1: Rate-limit error messages about page errors scsi: ufs: fix exception event handling mwifiex: correct histogram data with appropriate index PCI: pciehp: Request control of native hotplug only if supported pinctrl: at91-pio4: add missing of_node_put powerpc/8xx: fix invalid register expression in head_8xx.S powerpc/powermac: Mark variable x as unused powerpc/powermac: Add missing prototype for note_bootable_part() powerpc/chrp/time: Make some functions static, add missing header include powerpc/32: Add a missing include header ath: Add regulatory mapping for Bahamas ath: Add regulatory mapping for Bermuda ath: Add regulatory mapping for Serbia ath: Add regulatory mapping for Tanzania ath: Add regulatory mapping for Uganda ath: Add regulatory mapping for APL2_FCCA ath: Add regulatory mapping for APL13_WORLD ath: Add regulatory mapping for ETSI8_WORLD ath: Add regulatory mapping for FCC3_ETSIC PCI: Prevent sysfs disable of device while driver is attached btrfs: qgroup: Finish rescan when hit the last leaf of extent tree btrfs: add barriers to btrfs_sync_log before log_commit_wait wakeups media: videobuf2-core: don't call memop 'finish' when queueing wlcore: sdio: check for valid platform device data before suspend mwifiex: handle race during mwifiex_usb_disconnect mfd: cros_ec: Fail early if we cannot identify the EC ASoC: dpcm: fix BE dai not hw_free and shutdown Bluetooth: btusb: Add a new Realtek 8723DE ID 2ff8:b011 Bluetooth: hci_qca: Fix "Sleep inside atomic section" warning iwlwifi: pcie: fix race in Rx buffer allocator perf/x86/intel/uncore: Correct fixed counter index check for NHM perf/x86/intel/uncore: Correct fixed counter index check in generic code usbip: usbip_detach: Fix memory, udev context and udev leak f2fs: fix to don't trigger writeback during recovery disable loading f2fs module on PAGE_SIZE > 4KB RDMA/mad: Convert BUG_ONs to error flows powerpc/64s: Fix compiler store ordering to SLB shadow area hvc_opal: don't set tb_ticks_per_usec in udbg_init_opal_common() infiniband: fix a possible use-after-free bug netfilter: ipset: List timing out entries with "timeout 1" instead of zero rtc: ensure rtc_set_alarm fails when alarms are not supported mm/slub.c: add __printf verification to slab_err() mm: vmalloc: avoid racy handling of debugobjects in vunmap nfsd: fix potential use-after-free in nfsd4_decode_getdeviceinfo ALSA: fm801: add error handling for snd_ctl_add ALSA: emu10k1: add error handling for snd_ctl_add xen/netfront: raise max number of slots in xennet_get_responses() tracing: Quiet gcc warning about maybe unused link variable tracing/kprobes: Fix trace_probe flags on enable_trace_kprobe() failure tracing: Fix possible double free in event_enable_trigger_func() tracing: Fix double free of event_trigger_data Input: elan_i2c - add another ACPI ID for Lenovo Ideapad 330-15AST Input: i8042 - add Lenovo LaVie Z to the i8042 reset list Input: elan_i2c - add ACPI ID for lenovo ideapad 330 MIPS: Fix off-by-one in pci_resource_to_user() kernel/sys.c: fix merge error with 4.4.144 Conflicts: drivers/scsi/ufs/ufshcd.c include/net/tcp.h net/socket.c Change-Id: Ie84fdcf54b0a45508f76ef56330291f54e35ed30 Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci-sysfs.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index ec91cd17bf34..5fb4ed6ea322 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -180,13 +180,16 @@ static ssize_t enable_store(struct device *dev, struct device_attribute *attr,
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- if (!val) {
- if (pci_is_enabled(pdev))
- pci_disable_device(pdev);
- else
- result = -EIO;
- } else
+ device_lock(dev);
+ if (dev->driver)
+ result = -EBUSY;
+ else if (val)
result = pci_enable_device(pdev);
+ else if (pci_is_enabled(pdev))
+ pci_disable_device(pdev);
+ else
+ result = -EIO;
+ device_unlock(dev);
return result < 0 ? result : count;
}