OSDN Git Service

sagit-ice-cold/kernel_xiaomi_msm8998.git
7 years agonfsd: special case truncates some more
Christoph Hellwig [Sun, 12 Mar 2017 08:23:38 +0000 (08:23 +0000)]
nfsd: special case truncates some more
am: 3ee4f442e5

Change-Id: I1d0858825f170caedb52ad76d321ac5249ebfe65

7 years agonfsd: minor nfsd_setattr cleanup
Christoph Hellwig [Sun, 12 Mar 2017 08:23:28 +0000 (08:23 +0000)]
nfsd: minor nfsd_setattr cleanup
am: 6030493a34

Change-Id: I14e3bf413e9594a771468a9fc6388822c8a67693

7 years agortlwifi: rtl8192c-common: Fix "BUG: KASAN:
Larry Finger [Sun, 12 Mar 2017 08:23:19 +0000 (08:23 +0000)]
rtlwifi: rtl8192c-common: Fix "BUG: KASAN:
am: 781e6a0838

Change-Id: Iacb0435f45bfd2a508e4a0fc352df9bf3234f6b3

7 years agortlwifi: Fix alignment issues
Ping-Ke Shih [Sun, 12 Mar 2017 08:23:09 +0000 (08:23 +0000)]
rtlwifi: Fix alignment issues
am: 6e10c33cb8

Change-Id: I404361f27bcb75884fbfe272696f59c67916154f

7 years agogfs2: Add missing rcu locking for glock lookup
Andrew Price [Sun, 12 Mar 2017 08:23:00 +0000 (08:23 +0000)]
gfs2: Add missing rcu locking for glock lookup
am: 70a09029b7

Change-Id: I936502d0217b7206108e4ff5eb087ff22044da40

7 years agordma_cm: fail iwarp accepts w/o connection params
Steve Wise [Sun, 12 Mar 2017 08:22:49 +0000 (08:22 +0000)]
rdma_cm: fail iwarp accepts w/o connection params
am: 44dd30e04c

Change-Id: I74cd1d6f0c218f84c037f088b4b39569c97c38dd

7 years agoRDMA/core: Fix incorrect structure packing for booleans
Jason Gunthorpe [Sun, 12 Mar 2017 08:22:39 +0000 (08:22 +0000)]
RDMA/core: Fix incorrect structure packing for booleans
am: 88326fe95f

Change-Id: I324f6a5c39fde9a0b603c3a4576375124d4e68d1

7 years agoDrivers: hv: util: Backup: Fix a rescind processing issue
K. Y. Srinivasan [Sun, 12 Mar 2017 08:22:30 +0000 (08:22 +0000)]
Drivers: hv: util: Backup: Fix a rescind processing issue
am: f414af249f

Change-Id: I80ae316d5d7c94bfc9c8610a42fcee7138688b75

7 years agoDrivers: hv: util: Fcopy: Fix a rescind processing issue
K. Y. Srinivasan [Sun, 12 Mar 2017 08:22:18 +0000 (08:22 +0000)]
Drivers: hv: util: Fcopy: Fix a rescind processing issue
am: 9b45ab2853

Change-Id: Ie39ca59a15db54a99d05b83db89d25550b030521

7 years agoDrivers: hv: util: kvp: Fix a rescind processing issue
K. Y. Srinivasan [Sun, 12 Mar 2017 08:22:07 +0000 (08:22 +0000)]
Drivers: hv: util: kvp: Fix a rescind processing issue
am: abaeda7f70

Change-Id: I62b201fc485b6d7729bcfd5384513b1dffe6ebb1

7 years agohv: init percpu_list in hv_synic_alloc()
Vitaly Kuznetsov [Sun, 12 Mar 2017 08:21:58 +0000 (08:21 +0000)]
hv: init percpu_list in hv_synic_alloc()
am: 862d2b7d21

Change-Id: I927eb14d83669dd186fc5401d127d2e34f39d7bb

7 years agohv: allocate synic pages for all present CPUs
Vitaly Kuznetsov [Sun, 12 Mar 2017 08:21:43 +0000 (08:21 +0000)]
hv: allocate synic pages for all present CPUs
am: 374907e8d1

Change-Id: I02cedccd5cf715fd4b48f75daa30d1316f8048bc

7 years agousb: gadget: udc: fsl: Add missing complete function.
Magnus Lilja [Sun, 12 Mar 2017 08:21:32 +0000 (08:21 +0000)]
usb: gadget: udc: fsl: Add missing complete function.
am: 80190fcc48

Change-Id: Ib4f93f39b176b203c78a63bcdd8ab6b215db5b31

7 years agousb: host: xhci: plat: check hcc_params after add hcd
William wu [Sun, 12 Mar 2017 08:21:22 +0000 (08:21 +0000)]
usb: host: xhci: plat: check hcc_params after add hcd
am: 61e9e9bcfd

Change-Id: I34fa79dc6db2afab25940511c4993bf616a194bc

7 years agousb: musb: da8xx: Remove CPPI 3.0 quirk and methods
Alexandre Bailon [Sun, 12 Mar 2017 08:21:12 +0000 (08:21 +0000)]
usb: musb: da8xx: Remove CPPI 3.0 quirk and methods
am: 900466a746

Change-Id: Icbe05d3d58966174fac972609a3b0aeba34c01d3

7 years agow1: ds2490: USB transfer buffers need to be DMAable
Maciej S. Szmigiero [Sun, 12 Mar 2017 08:21:03 +0000 (08:21 +0000)]
w1: ds2490: USB transfer buffers need to be DMAable
am: 89eb5ed153

Change-Id: I03eeec3eed9a3d21d893cc2f68274ddd99755852

7 years agow1: don't leak refcount on slave attach failure in w1_attach_slave_device()
Maciej S. Szmigiero [Sun, 12 Mar 2017 08:20:53 +0000 (08:20 +0000)]
w1: don't leak refcount on slave attach failure in w1_attach_slave_device()
am: 1df66c4524

Change-Id: I60200dc28a2dd8d0349261225764a64e1991c789

7 years agocan: usb_8dev: Fix memory leak of priv->cmd_msg_buffer
Marc Kleine-Budde [Sun, 12 Mar 2017 08:20:43 +0000 (08:20 +0000)]
can: usb_8dev: Fix memory leak of priv->cmd_msg_buffer
am: 20bc8a897e

Change-Id: Ieef9c24ff41bdc07f95887c9192d325328962a25

7 years agoiio: pressure: mpl3115: do not rely on structure field ordering
Peter Rosin [Sun, 12 Mar 2017 08:20:34 +0000 (08:20 +0000)]
iio: pressure: mpl3115: do not rely on structure field ordering
am: 3584716db1

Change-Id: I1d115f813e9101c65802745e6ac5c9b9b09237f0

7 years agoiio: pressure: mpl115: do not rely on structure field ordering
Peter Rosin [Sun, 12 Mar 2017 08:20:24 +0000 (08:20 +0000)]
iio: pressure: mpl115: do not rely on structure field ordering
am: 2ab6b8c717

Change-Id: Ic82b55fc5ed4a3f92939355b4324427ec52c5436

7 years agoarm/arm64: KVM: Enforce unconditional flush to PoC when mapping to stage-2
Marc Zyngier [Sun, 12 Mar 2017 08:20:15 +0000 (08:20 +0000)]
arm/arm64: KVM: Enforce unconditional flush to PoC when mapping to stage-2
am: e83a28c521

Change-Id: I0e1de5d2d64401624e0cb37b9b92cb9941081869

7 years agofuse: add missing FR_FORCE
Miklos Szeredi [Sun, 12 Mar 2017 08:20:05 +0000 (08:20 +0000)]
fuse: add missing FR_FORCE
am: d4a8db66b9

Change-Id: I0ab1ff44762da9ee940038bb84dfbc74af15c637

7 years agocrypto: testmgr - Pad aes_ccm_enc_tv_template vector
Laura Abbott [Sun, 12 Mar 2017 08:19:54 +0000 (08:19 +0000)]
crypto: testmgr - Pad aes_ccm_enc_tv_template vector
am: 434ed4aff1

Change-Id: Ia925d3cad8b56e754efcc7b981e0b91692b86b5a

7 years agoath9k: use correct OTP register offsets for the AR9340 and AR9550
Christian Lamparter [Sun, 12 Mar 2017 08:19:44 +0000 (08:19 +0000)]
ath9k: use correct OTP register offsets for the AR9340 and AR9550
am: 7666ef1a36

Change-Id: Ide87c402232ce2e615b68676692dac446b645022

7 years agoath9k: fix race condition in enabling/disabling IRQs
Felix Fietkau [Sun, 12 Mar 2017 08:19:35 +0000 (08:19 +0000)]
ath9k: fix race condition in enabling/disabling IRQs
am: 1aeced70f7

Change-Id: Ifcf5e90179052b66d3e1d97ade82f98a92c0b14d

7 years agoath5k: drop bogus warning on drv_set_key with unsupported cipher
Felix Fietkau [Sun, 12 Mar 2017 08:19:25 +0000 (08:19 +0000)]
ath5k: drop bogus warning on drv_set_key with unsupported cipher
am: dc7bbf895e

Change-Id: I2c600fe8403bb76a3417d33eee4c27cb0a7d57fc

7 years agotarget: Fix multi-session dynamic se_node_acl double free OOPs
Nicholas Bellinger [Sun, 12 Mar 2017 08:19:16 +0000 (08:19 +0000)]
target: Fix multi-session dynamic se_node_acl double free OOPs
am: 6af0acc0b6

Change-Id: Iaa5c0362e6956f9303e5ec68b70567cb3b583dbb

7 years agotarget: Obtain se_node_acl->acl_kref during get_initiator_node_acl
Nicholas Bellinger [Sun, 12 Mar 2017 08:19:07 +0000 (08:19 +0000)]
target: Obtain se_node_acl->acl_kref during get_initiator_node_acl
am: 4a3c526ced

Change-Id: I0fb88f8fdf1fdc1a6e70cba5e0dac48c18996871

7 years agosamples/seccomp: fix 64-bit comparison macros
Mathias Svensson [Sun, 12 Mar 2017 08:18:55 +0000 (08:18 +0000)]
samples/seccomp: fix 64-bit comparison macros
am: da259399e4

Change-Id: Ia3823255a3bea3a9d52b96c5729817c1d9221ff1

7 years agoext4: return EROFS if device is r/o and journal replay is needed
Theodore Ts'o [Sun, 12 Mar 2017 08:18:46 +0000 (08:18 +0000)]
ext4: return EROFS if device is r/o and journal replay is needed
am: 6ad4196f19

Change-Id: Id2fea1964520c451afc4bfd2d903526bff0ff090

7 years agoext4: preserve the needs_recovery flag when the journal is aborted
Theodore Ts'o [Sun, 12 Mar 2017 08:18:36 +0000 (08:18 +0000)]
ext4: preserve the needs_recovery flag when the journal is aborted
am: 9a79248c08

Change-Id: I46020005a8613c856baf796a1bd799958e9345d0

7 years agoext4: fix inline data error paths
Theodore Ts'o [Sun, 12 Mar 2017 08:18:26 +0000 (08:18 +0000)]
ext4: fix inline data error paths
am: 6ec4583e9b

Change-Id: I288454fe8c77883f859f8bb7705727bd8c52c378

7 years agoext4: fix data corruption in data=journal mode
Jan Kara [Sun, 12 Mar 2017 08:18:16 +0000 (08:18 +0000)]
ext4: fix data corruption in data=journal mode
am: 9d636818db

Change-Id: Idc4320c3f0fa867216d8770b5ad186226e61152a

7 years agoext4: trim allocation requests to group size
Jan Kara [Sun, 12 Mar 2017 08:18:07 +0000 (08:18 +0000)]
ext4: trim allocation requests to group size
am: 8774c73cf6

Change-Id: I7ef4daf4451a8e8373f8e6e0cf07e08c676c9921

7 years agoext4: do not polute the extents cache while shifting extents
Roman Pen [Sun, 12 Mar 2017 08:17:57 +0000 (08:17 +0000)]
ext4: do not polute the extents cache while shifting extents
am: a3068b3e80

Change-Id: I8a8eb01160a8dca91e99709f5247b9d159847c70

7 years agoext4: Include forgotten start block on fallocate insert range
Roman Pen [Sun, 12 Mar 2017 08:17:48 +0000 (08:17 +0000)]
ext4: Include forgotten start block on fallocate insert range
am: 3daefdae5f

Change-Id: I96ed2bfb756e3a37c07656d632660757c100065b

7 years agoloop: fix LO_FLAGS_PARTSCAN hang
Omar Sandoval [Sun, 12 Mar 2017 08:17:38 +0000 (08:17 +0000)]
loop: fix LO_FLAGS_PARTSCAN hang
am: cd3db55c64

Change-Id: I19b2069183011982702a38dfad5f2b589bbd3f4e

7 years agoblock/loop: fix race between I/O and set_status
Ming Lei [Sun, 12 Mar 2017 08:17:29 +0000 (08:17 +0000)]
block/loop: fix race between I/O and set_status
am: 356d71df73

Change-Id: I57316c57bb82477bd2e6d24047b9399016c48348

7 years agojbd2: don't leak modified metadata buffers on an aborted journal
Theodore Ts'o [Sun, 12 Mar 2017 08:17:19 +0000 (08:17 +0000)]
jbd2: don't leak modified metadata buffers on an aborted journal
am: 973f40f368

Change-Id: I3c95a6a0e9d2daa4713da89a47c3aac6b6193d02

7 years agoFix: Disable sys_membarrier when nohz_full is enabled
Mathieu Desnoyers [Sun, 12 Mar 2017 08:17:10 +0000 (08:17 +0000)]
Fix: Disable sys_membarrier when nohz_full is enabled
am: c0ef1f537a

Change-Id: I3650becd64c5156d24dee601990d48c68057e81d

7 years agosd: get disk reference in sd_check_events()
Hannes Reinecke [Sun, 12 Mar 2017 08:17:00 +0000 (08:17 +0000)]
sd: get disk reference in sd_check_events()
am: ea240cfed9

Change-Id: Ie5d8f2f3588859d8a4f4466c158223afbf8e2ecb

7 years agoscsi: use 'scsi_device_from_queue()' for scsi_dh
Hannes Reinecke [Sun, 12 Mar 2017 08:16:50 +0000 (08:16 +0000)]
scsi: use 'scsi_device_from_queue()' for scsi_dh
am: 33950b56d2

Change-Id: Ie22776722d50f3c91cfdebd8e89284e123cf2648

7 years agoscsi: aacraid: Reorder Adapter status check
Raghava Aditya Renukunta [Sun, 12 Mar 2017 08:16:41 +0000 (08:16 +0000)]
scsi: aacraid: Reorder Adapter status check
am: 2dc9a859eb

Change-Id: Idbd0d6bc38a75a802547ad44280c72f83d930604

7 years agoscsi: storvsc: properly set residual data length on errors
Long Li [Sun, 12 Mar 2017 08:16:33 +0000 (08:16 +0000)]
scsi: storvsc: properly set residual data length on errors
am: 18dbfcae65

Change-Id: Icd112397502c0caed46d5c3613e9cb2720901e6f

7 years agoscsi: storvsc: properly handle SRB_ERROR when sense message is present
Long Li [Sun, 12 Mar 2017 08:16:23 +0000 (08:16 +0000)]
scsi: storvsc: properly handle SRB_ERROR when sense message is present
am: 80bccab34a

Change-Id: Ia376c2f0f0a0b1328b60ed5fb707fe5a12ec64ad

7 years agoscsi: storvsc: use tagged SRB requests if supported by the device
Long Li [Sun, 12 Mar 2017 08:16:12 +0000 (08:16 +0000)]
scsi: storvsc: use tagged SRB requests if supported by the device
am: 5cdc8193ac

Change-Id: Id08acaf5e82dcfb9f447ba4e375f97423ae216b4

7 years agodm stats: fix a leaked s->histogram_boundaries array
Mikulas Patocka [Sun, 12 Mar 2017 08:16:03 +0000 (08:16 +0000)]
dm stats: fix a leaked s->histogram_boundaries array
am: 6a284310d5

Change-Id: Iffdf38daa52f8e2386d20f50ae62dae523c41991

7 years agodm cache: fix corruption seen when using cache > 2TB
Joe Thornber [Sun, 12 Mar 2017 08:15:54 +0000 (08:15 +0000)]
dm cache: fix corruption seen when using cache > 2TB
am: fdea1f9721

Change-Id: Ife7330de88f3c77653c946783ea95ca393b3d1b4

7 years agoipc/shm: Fix shmat mmap nil-page protection
Davidlohr Bueso [Sun, 12 Mar 2017 08:15:46 +0000 (08:15 +0000)]
ipc/shm: Fix shmat mmap nil-page protection
am: f0ae01568e

Change-Id: I53489954b39ece583120b8462d57a969ab1e972f

7 years agomm: do not access page->mapping directly on page_endio
Minchan Kim [Sun, 12 Mar 2017 08:15:36 +0000 (08:15 +0000)]
mm: do not access page->mapping directly on page_endio
am: c5c893e7c4

Change-Id: Ic37f4022408ccc77d7702ebc4be606bd94ad20e1

7 years agomm: vmpressure: fix sending wrong events on underflow
Vinayak Menon [Sun, 12 Mar 2017 08:15:27 +0000 (08:15 +0000)]
mm: vmpressure: fix sending wrong events on underflow
am: 66f43a5768

Change-Id: I914c9c65e90dc02251788277937daca32fd59818

7 years agomm/page_alloc: fix nodes for reclaim in fast path
Gavin Shan [Sun, 12 Mar 2017 08:15:17 +0000 (08:15 +0000)]
mm/page_alloc: fix nodes for reclaim in fast path
am: 612e4679b8

Change-Id: I134dc72c598a798d4f3dead4421c269ae7bb3791

7 years agoiommu/vt-d: Tylersburg isoch identity map check is done too late.
Ashok Raj [Sun, 12 Mar 2017 08:15:08 +0000 (08:15 +0000)]
iommu/vt-d: Tylersburg isoch identity map check is done too late.
am: 31dac0e870

Change-Id: I0e8dacd983deed5a478e50a4ce4c48622668e563

7 years agoiommu/vt-d: Fix some macros that are incorrectly specified in intel-iommu
CQ Tang [Sun, 12 Mar 2017 08:14:59 +0000 (08:14 +0000)]
iommu/vt-d: Fix some macros that are incorrectly specified in intel-iommu
am: 07852563db

Change-Id: I19ddfcf5d9f41e3fc8580b6449b27c1485b06e16

7 years agoregulator: Fix regulator_summary for deviceless consumers
Leonard Crestez [Sun, 12 Mar 2017 08:14:49 +0000 (08:14 +0000)]
regulator: Fix regulator_summary for deviceless consumers
am: 5cc0cd0e3a

Change-Id: I9bcef233094a090abaa0d344853f8f249ff5351f

7 years agostaging: rtl: fix possible NULL pointer dereference
Arnd Bergmann [Sun, 12 Mar 2017 08:14:40 +0000 (08:14 +0000)]
staging: rtl: fix possible NULL pointer dereference
am: 272d60bfce

Change-Id: I49cd1afa12c293484de6c18eb31e67d2baa0a4d4

7 years agoALSA: hda - Fix micmute hotkey problem for a lenovo AIO machine
Hui Wang [Sun, 12 Mar 2017 08:14:31 +0000 (08:14 +0000)]
ALSA: hda - Fix micmute hotkey problem for a lenovo AIO machine
am: 8c8f42c9a4

Change-Id: I0075697f99a22a1364d3ecdc993c1257662f9eb5

7 years agoALSA: hda - Add subwoofer support for Dell Inspiron 17 7000 Gaming
Takashi Iwai [Sun, 12 Mar 2017 08:14:21 +0000 (08:14 +0000)]
ALSA: hda - Add subwoofer support for Dell Inspiron 17 7000 Gaming
am: cd585d3ba5

Change-Id: I7d9b34fdcf5dcc2d88d5cd0c1ebf263eefcf6acf

7 years agoALSA: seq: Fix link corruption by event error handling
Takashi Iwai [Sun, 12 Mar 2017 08:14:11 +0000 (08:14 +0000)]
ALSA: seq: Fix link corruption by event error handling
am: 003aa34372

Change-Id: I5c14157cc11ff09f45950d0b9a58dcc2c22535d4

7 years agoALSA: ctxfi: Fallback DMA mask to 32bit
Takashi Iwai [Sun, 12 Mar 2017 08:14:01 +0000 (08:14 +0000)]
ALSA: ctxfi: Fallback DMA mask to 32bit
am: 70dbc00f7e

Change-Id: If4ce0b2e8a727aa341bdd484eb920ba33f09707d

7 years agoALSA: timer: Reject user params with too small ticks
Takashi Iwai [Sun, 12 Mar 2017 08:13:51 +0000 (08:13 +0000)]
ALSA: timer: Reject user params with too small ticks
am: 9879f9d01a

Change-Id: I3fb699e66b0e89da94eea1124c89fedf9f2cc576

7 years agoALSA: hda - fix Lewisburg audio issue
Jaroslav Kysela [Sun, 12 Mar 2017 08:13:42 +0000 (08:13 +0000)]
ALSA: hda - fix Lewisburg audio issue
am: b9bf1f0657

Change-Id: Ib9f0327ded792418c9c5d5531257fdacfef23ad8

7 years agoALSA: hda/realtek - Cannot adjust speaker's volume on a Dell AIO
Kai-Heng Feng [Sun, 12 Mar 2017 08:13:33 +0000 (08:13 +0000)]
ALSA: hda/realtek - Cannot adjust speaker's volume on a Dell AIO
am: 1f4f37076d

Change-Id: I644061092b4149f275fa5de0354a57ad2711b9a7

7 years agoARM: dts: at91: Enable DMA on sama5d2_xplained console
Alexandre Belloni [Sun, 12 Mar 2017 08:13:24 +0000 (08:13 +0000)]
ARM: dts: at91: Enable DMA on sama5d2_xplained console
am: 6b1d7b6f54

Change-Id: Id2e050faf5544cd7ea2cd5f414c851550ea59f70

7 years agoARM: dts: at91: Enable DMA on sama5d4_xplained console
Alexandre Belloni [Sun, 12 Mar 2017 08:13:15 +0000 (08:13 +0000)]
ARM: dts: at91: Enable DMA on sama5d4_xplained console
am: be83ed085f

Change-Id: Ia3caad88499707a3c3c011e29b89dc2197231ba4

7 years agoARM: at91: define LPDDR types
Alexandre Belloni [Sun, 12 Mar 2017 08:13:05 +0000 (08:13 +0000)]
ARM: at91: define LPDDR types
am: b401418c6c

Change-Id: I3a3a6313fb6e75193fd502aa2b54401d218493c0

7 years agomedia: fix dm1105.c build error
Randy Dunlap [Sun, 12 Mar 2017 08:12:57 +0000 (08:12 +0000)]
media: fix dm1105.c build error
am: f3a0b20040

Change-Id: Icd2cd4503a794b66d64c45659b73f870d032eb65

7 years agouvcvideo: Fix a wrong macro
Guennadi Liakhovetski [Sun, 12 Mar 2017 08:12:47 +0000 (08:12 +0000)]
uvcvideo: Fix a wrong macro
am: b0bde9f6a0

Change-Id: I5c521825b9659f7ff74b8708550930f86a278b91

7 years agoam437x-vpfe: always assign bpp variable
Nicolas Iooss [Sun, 12 Mar 2017 08:12:38 +0000 (08:12 +0000)]
am437x-vpfe: always assign bpp variable
am: 5988e73201

Change-Id: I2bdb0d627980fa6a38dd774e1f27c400edcbae76

7 years agoMIPS: Handle microMIPS jumps in the same way as MIPS32/MIPS64 jumps
Paul Burton [Sun, 12 Mar 2017 08:12:28 +0000 (08:12 +0000)]
MIPS: Handle microMIPS jumps in the same way as MIPS32/MIPS64 jumps
am: ab7546e491

Change-Id: Idcfd907ca44b5d0e5231e07e1945eb7a1e874f39

7 years agoMIPS: Calculate microMIPS ra properly when unwinding the stack
Paul Burton [Sun, 12 Mar 2017 08:12:19 +0000 (08:12 +0000)]
MIPS: Calculate microMIPS ra properly when unwinding the stack
am: cc387ae089

Change-Id: Ic8e08f715b0137db795069024c05dbbdcba65355

7 years agoMIPS: Fix is_jump_ins() handling of 16b microMIPS instructions
Paul Burton [Sun, 12 Mar 2017 08:12:09 +0000 (08:12 +0000)]
MIPS: Fix is_jump_ins() handling of 16b microMIPS instructions
am: d75d675a05

Change-Id: I21332f13b7cb7a85cca19151ef909445879e2b44

7 years agoMIPS: Fix get_frame_info() handling of microMIPS function size
Paul Burton [Sun, 12 Mar 2017 08:12:01 +0000 (08:12 +0000)]
MIPS: Fix get_frame_info() handling of microMIPS function size
am: 72a0cfae59

Change-Id: Id3a27d9cecbf32d7796c41fbd66865e04a0bf5a4

7 years agoMIPS: Prevent unaligned accesses during stack unwinding
Paul Burton [Sun, 12 Mar 2017 08:11:51 +0000 (08:11 +0000)]
MIPS: Prevent unaligned accesses during stack unwinding
am: 2998bf60d3

Change-Id: I35cd0b6a76195d79d0416447d90f5168637c00dd

7 years agoMIPS: Clear ISA bit correctly in get_frame_info()
Paul Burton [Sun, 12 Mar 2017 08:11:42 +0000 (08:11 +0000)]
MIPS: Clear ISA bit correctly in get_frame_info()
am: 0d45490221

Change-Id: I531d407a5a29d93c60ac199b7ff7d13ced328c05

7 years agoMIPS: Lantiq: Keep ethernet enabled during boot
Felix Fietkau [Sun, 12 Mar 2017 08:11:34 +0000 (08:11 +0000)]
MIPS: Lantiq: Keep ethernet enabled during boot
am: f1be0f5814

Change-Id: Id823b48dec5de9b66ca8f98eaffd4cb5eba52efe

7 years agoMIPS: OCTEON: Fix copy_from_user fault handling for large buffers
James Cowgill [Sun, 12 Mar 2017 08:11:25 +0000 (08:11 +0000)]
MIPS: OCTEON: Fix copy_from_user fault handling for large buffers
am: 093292b8f8

Change-Id: I366bdcba20ff678b6796f1805be0940297292dcd

7 years agoMIPS: BCM47XX: Fix button inversion for Asus WL-500W
Mirko Parthey [Sun, 12 Mar 2017 08:11:15 +0000 (08:11 +0000)]
MIPS: BCM47XX: Fix button inversion for Asus WL-500W
am: b32e43cf3f

Change-Id: Ida853a4548c2f09b1fe2d070c25cad409d022525

7 years agoMIPS: Fix special case in 64 bit IP checksumming.
Ralf Baechle [Sun, 12 Mar 2017 08:11:06 +0000 (08:11 +0000)]
MIPS: Fix special case in 64 bit IP checksumming.
am: 5636da7aba

Change-Id: I9ca72b7b7dbf94ecc4be5aaa910024ead497165c

7 years agosamples: move mic/mpssd example code from Documentation
Shuah Khan [Sun, 12 Mar 2017 08:10:58 +0000 (08:10 +0000)]
samples: move mic/mpssd example code from Documentation
am: faf6aa4b12

Change-Id: I7ed0b2c9987635d6e46fa9207cc9c7457896b536

7 years agonfsd: special case truncates some more
Christoph Hellwig [Mon, 20 Feb 2017 06:21:33 +0000 (07:21 +0100)]
nfsd: special case truncates some more

commit 783112f7401ff449d979530209b3f6c2594fdb4e upstream.

Both the NFS protocols and the Linux VFS use a setattr operation with a
bitmap of attributes to set to set various file attributes including the
file size and the uid/gid.

The Linux syscalls never mix size updates with unrelated updates like
the uid/gid, and some file systems like XFS and GFS2 rely on the fact
that truncates don't update random other attributes, and many other file
systems handle the case but do not update the other attributes in the
same transaction.  NFSD on the other hand passes the attributes it gets
on the wire more or less directly through to the VFS, leading to updates
the file systems don't expect.  XFS at least has an assert on the
allowed attributes, which caught an unusual NFS client setting the size
and group at the same time.

To handle this issue properly this splits the notify_change call in
nfsd_setattr into two separate ones.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agonfsd: minor nfsd_setattr cleanup
Christoph Hellwig [Mon, 20 Feb 2017 22:04:42 +0000 (17:04 -0500)]
nfsd: minor nfsd_setattr cleanup

commit 758e99fefe1d9230111296956335cd35995c0eaf upstream.

Simplify exit paths, size_change use.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agortlwifi: rtl8192c-common: Fix "BUG: KASAN:
Larry Finger [Sun, 5 Feb 2017 16:24:22 +0000 (10:24 -0600)]
rtlwifi: rtl8192c-common: Fix "BUG: KASAN:

commit 6773386f977ce5af339f9678fa2918909a946c6b upstream.

Kernels built with CONFIG_KASAN=y report the following BUG for rtl8192cu
and rtl8192c-common:

==================================================================
BUG: KASAN: slab-out-of-bounds in rtl92c_dm_bt_coexist+0x858/0x1e40
     [rtl8192c_common] at addr ffff8801c90edb08
Read of size 1 by task kworker/0:1/38
page:ffffea0007243800 count:1 mapcount:0 mapping:          (null)
     index:0x0 compound_mapcount: 0
flags: 0x8000000000004000(head)
page dumped because: kasan: bad access detected
CPU: 0 PID: 38 Comm: kworker/0:1 Not tainted 4.9.7-gentoo #3
Hardware name: Gigabyte Technology Co., Ltd. To be filled by
     O.E.M./Z77-DS3H, BIOS F11a 11/13/2013
Workqueue: rtl92c_usb rtl_watchdog_wq_callback [rtlwifi]
  0000000000000000 ffffffff829eea33 ffff8801d7f0fa30 ffff8801c90edb08
  ffffffff824c0f09 ffff8801d4abee80 0000000000000004 0000000000000297
  ffffffffc070b57c ffff8801c7aa7c48 ffff880100000004 ffffffff000003e8
Call Trace:
  [<ffffffff829eea33>] ? dump_stack+0x5c/0x79
  [<ffffffff824c0f09>] ? kasan_report_error+0x4b9/0x4e0
  [<ffffffffc070b57c>] ? _usb_read_sync+0x15c/0x280 [rtl_usb]
  [<ffffffff824c0f75>] ? __asan_report_load1_noabort+0x45/0x50
  [<ffffffffc06d7a88>] ? rtl92c_dm_bt_coexist+0x858/0x1e40 [rtl8192c_common]
  [<ffffffffc06d7a88>] ? rtl92c_dm_bt_coexist+0x858/0x1e40 [rtl8192c_common]
  [<ffffffffc06d0cbe>] ? rtl92c_dm_rf_saving+0x96e/0x1330 [rtl8192c_common]
...

The problem is due to rtl8192ce and rtl8192cu sharing routines, and having
different layouts of struct rtl_pci_priv, which is used by rtl8192ce, and
struct rtl_usb_priv, which is used by rtl8192cu. The problem was resolved
by placing the struct bt_coexist_info at the head of each of those private
areas.

Reported-and-tested-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agortlwifi: Fix alignment issues
Ping-Ke Shih [Wed, 28 Dec 2016 21:40:04 +0000 (15:40 -0600)]
rtlwifi: Fix alignment issues

commit 40b368af4b750863b2cb66a3a9513241db2f0793 upstream.

The addresses of Wlan NIC registers are natural alignment, but some
drivers have bugs. These are evident on platforms that need natural
alignment to access registers.  This change contains the following:
 1. Function _rtl8821ae_dbi_read() is used to read one byte from DBI,
    thus it should use rtl_read_byte().
 2. Register 0x4C7 of 8192ee is single byte.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agogfs2: Add missing rcu locking for glock lookup
Andrew Price [Wed, 22 Feb 2017 17:05:03 +0000 (12:05 -0500)]
gfs2: Add missing rcu locking for glock lookup

commit f38e5fb95a1f8feda88531eedc98f69b24748712 upstream.

We must hold the rcu read lock across looking up glocks and trying to
bump their refcount to prevent the glocks from being freed in between.

Signed-off-by: Andrew Price <anprice@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agordma_cm: fail iwarp accepts w/o connection params
Steve Wise [Tue, 21 Feb 2017 19:21:57 +0000 (11:21 -0800)]
rdma_cm: fail iwarp accepts w/o connection params

commit f2625f7db4dd0bbd16a9c7d2950e7621f9aa57ad upstream.

cma_accept_iw() needs to return an error if conn_params is NULL.
Since this is coming from user space, we can crash.

Reported-by: Shaobo He <shaobo@cs.utah.edu>
Acked-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoRDMA/core: Fix incorrect structure packing for booleans
Jason Gunthorpe [Fri, 23 Dec 2016 01:07:52 +0000 (18:07 -0700)]
RDMA/core: Fix incorrect structure packing for booleans

commit 55efcfcd7776165b294f8b5cd6e05ca00ec89b7c upstream.

The RDMA core uses ib_pack() to convert from unpacked CPU structs
to on-the-wire bitpacked structs.

This process requires that 1 bit fields are declared as u8 in the
unpacked struct, otherwise the packing process does not read the
value properly and the packed result is wired to 0. Several
places wrongly used int.

Crucially this means the kernel has never, set reversible
correctly in the path record request. It has always asked for
irreversible paths even if the ULP requests otherwise.

When the kernel is used with a SM that supports this feature, it
completely breaks communication management if reversible paths are
not properly requested.

The only reason this ever worked is because opensm ignores the
reversible bit.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoDrivers: hv: util: Backup: Fix a rescind processing issue
K. Y. Srinivasan [Fri, 23 Dec 2016 00:54:03 +0000 (16:54 -0800)]
Drivers: hv: util: Backup: Fix a rescind processing issue

commit d77044d142e960f7b5f814a91ecb8bcf86aa552c upstream.

VSS may use a char device to support the communication between
the user level daemon and the driver. When the VSS channel is rescinded
we need to make sure that the char device is fully cleaned up before
we can process a new VSS offer from the host. Implement this logic.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoDrivers: hv: util: Fcopy: Fix a rescind processing issue
K. Y. Srinivasan [Fri, 23 Dec 2016 00:54:02 +0000 (16:54 -0800)]
Drivers: hv: util: Fcopy: Fix a rescind processing issue

commit 20951c7535b5e6af46bc37b7142105f716df739c upstream.

Fcopy may use a char device to support the communication between
the user level daemon and the driver. When the Fcopy channel is rescinded
we need to make sure that the char device is fully cleaned up before
we can process a new Fcopy offer from the host. Implement this logic.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoDrivers: hv: util: kvp: Fix a rescind processing issue
K. Y. Srinivasan [Fri, 23 Dec 2016 00:54:01 +0000 (16:54 -0800)]
Drivers: hv: util: kvp: Fix a rescind processing issue

commit 5a66fecbf6aa528e375cbebccb1061cc58d80c84 upstream.

KVP may use a char device to support the communication between
the user level daemon and the driver. When the KVP channel is rescinded
we need to make sure that the char device is fully cleaned up before
we can process a new KVP offer from the host. Implement this logic.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agohv: init percpu_list in hv_synic_alloc()
Vitaly Kuznetsov [Wed, 7 Dec 2016 09:16:26 +0000 (01:16 -0800)]
hv: init percpu_list in hv_synic_alloc()

commit 3c7630d35009e6635e5b58d62de554fd5b6db5df upstream.

Initializing hv_context.percpu_list in hv_synic_alloc() helps to prevent a
crash in percpu_channel_enq() when not all CPUs were online during
initialization and it naturally belongs there.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agohv: allocate synic pages for all present CPUs
Vitaly Kuznetsov [Wed, 7 Dec 2016 09:16:25 +0000 (01:16 -0800)]
hv: allocate synic pages for all present CPUs

commit 421b8f20d3c381b215f988b42428f56fc3b82405 upstream.

It may happen that not all CPUs are online when we do hv_synic_alloc() and
in case more CPUs come online later we may try accessing these allocated
structures.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agousb: gadget: udc: fsl: Add missing complete function.
Magnus Lilja [Wed, 25 Jan 2017 21:07:59 +0000 (22:07 +0100)]
usb: gadget: udc: fsl: Add missing complete function.

commit 5528954a1a0c49c6974ef1b8d6eaceff536204d5 upstream.

Commit 304f7e5e1d08 ("usb: gadget: Refactor request completion")
removed check if req->req.complete is non-NULL, resulting in a NULL
pointer derefence and a kernel panic.
This patch adds an empty complete function instead of re-introducing
the req->req.complete check.

Fixes: 304f7e5e1d08 ("usb: gadget: Refactor request completion")

Signed-off-by: Magnus Lilja <lilja.magnus@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agousb: host: xhci: plat: check hcc_params after add hcd
William wu [Tue, 17 Jan 2017 07:32:07 +0000 (15:32 +0800)]
usb: host: xhci: plat: check hcc_params after add hcd

commit 5de4e1ea9a731cad195ce5152705c21daef3bbba upstream.

The commit 4ac53087d6d4 ("usb: xhci: plat: Create both
HCDs before adding them") move add hcd to the end of
probe, this cause hcc_params uninitiated, because xHCI
driver sets hcc_params in xhci_gen_setup() called from
usb_add_hcd().

This patch checks the Maximum Primary Stream Array Size
in the hcc_params register after add primary hcd.

Signed-off-by: William wu <william.wu@rock-chips.com>
Acked-by: Roger Quadros <rogerq@ti.com>
Fixes: 4ac53087d6d4 ("usb: xhci: plat: Create both HCDs before adding them")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agousb: musb: da8xx: Remove CPPI 3.0 quirk and methods
Alexandre Bailon [Thu, 2 Feb 2017 03:30:12 +0000 (21:30 -0600)]
usb: musb: da8xx: Remove CPPI 3.0 quirk and methods

commit a994ce2d7e66008381a0b184c73be9ae9b72eb5c upstream.

DA8xx driver is registering and using the CPPI 3.0 DMA controller but
actually, the DA8xx has a CPPI 4.1 DMA controller.
Remove the CPPI 3.0 quirk and methods.

Fixes: f8e9f34f80a2 ("usb: musb: Fix up DMA related macros")
Fixes: 7f6283ed6fe8 ("usb: musb: Set up function pointers for DMA")
Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agow1: ds2490: USB transfer buffers need to be DMAable
Maciej S. Szmigiero [Wed, 18 Jan 2017 20:31:11 +0000 (21:31 +0100)]
w1: ds2490: USB transfer buffers need to be DMAable

commit 61cd1b4cd1e8f7f7642ab64529d9bd52e8374641 upstream.

ds2490 driver was doing USB transfers from / to buffers on a stack.
This is not permitted and made the driver non-working with vmapped stacks.

Since all these transfers are done under the same bus_mutex lock we can
simply use shared buffers in a device private structure for two most common
of them.

While we are at it, let's also fix a comparison between int and size_t in
ds9490r_search() which made the driver spin in this function if state
register get requests were failing.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agow1: don't leak refcount on slave attach failure in w1_attach_slave_device()
Maciej S. Szmigiero [Sat, 21 Jan 2017 22:50:18 +0000 (23:50 +0100)]
w1: don't leak refcount on slave attach failure in w1_attach_slave_device()

commit d2ce4ea1a0b0162e5d2d7e7942ab6f5cc2063d5a upstream.

Near the beginning of w1_attach_slave_device() we increment a w1 master
reference count.
Later, when we are going to exit this function without actually attaching
a slave device (due to failure of __w1_attach_slave_device()) we need to
decrement this reference count back.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Fixes: 9fcbbac5ded489 ("w1: process w1 netlink commands in w1_process thread")
Cc: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agocan: usb_8dev: Fix memory leak of priv->cmd_msg_buffer
Marc Kleine-Budde [Thu, 2 Mar 2017 11:03:40 +0000 (12:03 +0100)]
can: usb_8dev: Fix memory leak of priv->cmd_msg_buffer

commit 7c42631376306fb3f34d51fda546b50a9b6dd6ec upstream.

The priv->cmd_msg_buffer is allocated in the probe function, but never
kfree()ed. This patch converts the kzalloc() to resource-managed
kzalloc.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoiio: pressure: mpl3115: do not rely on structure field ordering
Peter Rosin [Wed, 1 Feb 2017 20:40:56 +0000 (21:40 +0100)]
iio: pressure: mpl3115: do not rely on structure field ordering

commit 9cf6cdba586ced75c69b8314b88b2d2f5ce9b3ed upstream.

Fixes a regression triggered by a change in the layout of
struct iio_chan_spec, but the real bug is in the driver which assumed
a specific structure layout in the first place. Hint: the two bits were
not OR:ed together as implied by the indentation prior to this patch,
there was a comma between them, which accidentally moved the ..._SCALE
bit to the next structure field. That field was .info_mask_shared_by_type
before the _available attributes was added by commit 51239600074b
("iio:core: add a callback to allow drivers to provide _available
attributes") and .info_mask_separate_available afterwards, and the
regression happened.

info_mask_shared_by_type is actually a better choice than the originally
intended info_mask_separate for the ..._SCALE bit since a constant is
returned from mpl3115_read_raw for the scale. Using
info_mask_shared_by_type also preserves the behavior from before the
regression and is therefore less likely to cause other interesting side
effects.

The above mentioned regression causes an unintended sysfs attibute to
show up that is not backed by code, in turn causing the following NULL
pointer defererence to happen on access.

Segmentation fault

Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = ecc3c000
[00000000] *pgd=87f91831
Internal error: Oops: 80000007 [#1] SMP ARM
Modules linked in:
CPU: 1 PID: 1051 Comm: cat Not tainted 4.10.0-rc5-00009-gffd8858-dirty #3
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
task: ed54ec00 task.stack: ee2bc000
PC is at 0x0
LR is at iio_read_channel_info_avail+0x40/0x280
pc : [<00000000>]    lr : [<c06fbc1c>]    psr: a0070013
sp : ee2bdda8  ip : 00000000  fp : ee2bddf4
r10: c0a53c74  r9 : ed79f000  r8 : ee8d1018
r7 : 00001000  r6 : 00000fff  r5 : ee8b9a00  r4 : ed79f000
r3 : ee2bddc4  r2 : ee2bddbc  r1 : c0a86dcc  r0 : ee8d1000
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 10c5387d  Table: 3cc3c04a  DAC: 00000051
Process cat (pid: 1051, stack limit = 0xee2bc210)
Stack: (0xee2bdda8 to 0xee2be000)
dda0:                   ee2bddc0 00000002 c016d720 c016d394 ed54ec00 00000000
ddc0: 60070013 ed413780 00000001 edffd480 ee8b9a00 00000fff 00001000 ee8d1018
dde0: ed79f000 c0a53c74 ee2bde0c ee2bddf8 c0513c58 c06fbbe8 edffd480 edffd540
de00: ee2bde3c ee2bde10 c0293474 c0513c40 c02933e4 ee2bde60 00000001 ed413780
de20: 00000001 ed413780 00000000 edffd480 ee2bde4c ee2bde40 c0291d00 c02933f0
de40: ee2bde9c ee2bde50 c024679c c0291ce0 edffd4b0 b6e37000 00020000 ee2bdf78
de60: 00000000 00000000 ed54ec00 ed013200 00000817 c0a111fc edffd540 ed413780
de80: b6e37000 00020000 00020000 ee2bdf78 ee2bded4 ee2bdea0 c0292890 c0246604
dea0: c0117940 c016ba50 00000025 c0a111fc b6e37000 ed413780 ee2bdf78 00020000
dec0: ee2bc000 b6e37000 ee2bdf44 ee2bded8 c021d158 c0292770 c0117764 b6e36004
dee0: c0f0d7c4 ee2bdfb0 b6f89228 00021008 ee2bdfac ee2bdf00 c0101374 c0117770
df00: 00000000 00000000 ee2bc000 00000000 ee2bdf34 ee2bdf20 c016ba04 c0171080
df20: 00000000 00020000 ed413780 b6e37000 00000000 ee2bdf78 ee2bdf74 ee2bdf48
df40: c021e7a0 c021d130 c023e300 c023e280 ee2bdf74 00000000 00000000 ed413780
df60: ed413780 00020000 ee2bdfa4 ee2bdf78 c021e870 c021e71c 00000000 00000000
df80: 00020000 00020000 b6e37000 00000003 c0108084 00000000 00000000 ee2bdfa8
dfa0: c0107ee0 c021e838 00020000 00020000 00000003 b6e37000 00020000 0001a2b4
dfc0: 00020000 00020000 b6e37000 00000003 7fffe000 00000000 00000000 00020000
dfe0: 00000000 be98eb4c 0000c740 b6f1985c 60070010 00000003 00000000 00000000
Backtrace:
[<c06fbbdc>] (iio_read_channel_info_avail) from [<c0513c58>] (dev_attr_show+0x24/0x50)
 r10:c0a53c74 r9:ed79f000 r8:ee8d1018 r7:00001000 r6:00000fff r5:ee8b9a00
 r4:edffd480
[<c0513c34>] (dev_attr_show) from [<c0293474>] (sysfs_kf_seq_show+0x90/0x110)
 r5:edffd540 r4:edffd480
[<c02933e4>] (sysfs_kf_seq_show) from [<c0291d00>] (kernfs_seq_show+0x2c/0x30)
 r10:edffd480 r9:00000000 r8:ed413780 r7:00000001 r6:ed413780 r5:00000001
 r4:ee2bde60 r3:c02933e4
[<c0291cd4>] (kernfs_seq_show) from [<c024679c>] (seq_read+0x1a4/0x4e0)
[<c02465f8>] (seq_read) from [<c0292890>] (kernfs_fop_read+0x12c/0x1cc)
 r10:ee2bdf78 r9:00020000 r8:00020000 r7:b6e37000 r6:ed413780 r5:edffd540
 r4:c0a111fc
[<c0292764>] (kernfs_fop_read) from [<c021d158>] (__vfs_read+0x34/0x118)
 r10:b6e37000 r9:ee2bc000 r8:00020000 r7:ee2bdf78 r6:ed413780 r5:b6e37000
 r4:c0a111fc
[<c021d124>] (__vfs_read) from [<c021e7a0>] (vfs_read+0x90/0x11c)
 r8:ee2bdf78 r7:00000000 r6:b6e37000 r5:ed413780 r4:00020000
[<c021e710>] (vfs_read) from [<c021e870>] (SyS_read+0x44/0x90)
 r8:00020000 r7:ed413780 r6:ed413780 r5:00000000 r4:00000000
[<c021e82c>] (SyS_read) from [<c0107ee0>] (ret_fast_syscall+0x0/0x1c)
 r10:00000000 r8:c0108084 r7:00000003 r6:b6e37000 r5:00020000 r4:00020000
Code: bad PC value
---[ end trace 9c4938ccd0389004 ]---

Fixes: cc26ad455f57 ("iio: Add Freescale MPL3115A2 pressure / temperature sensor driver")
Fixes: 51239600074b ("iio:core: add a callback to allow drivers to provide _available attributes")
Reported-by: Ken Lin <ken.lin@advantech.com>
Tested-by: Ken Lin <ken.lin@advantech.com>
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoiio: pressure: mpl115: do not rely on structure field ordering
Peter Rosin [Wed, 1 Feb 2017 20:40:57 +0000 (21:40 +0100)]
iio: pressure: mpl115: do not rely on structure field ordering

commit 6a6e1d56a0769795a36c0461c64bf5e5b9bbb4c0 upstream.

Fixes a regression triggered by a change in the layout of
struct iio_chan_spec, but the real bug is in the driver which assumed
a specific structure layout in the first place. Hint: the three bits were
not OR:ed together as implied by the indentation prior to this patch,
there was a comma between the first two, which accidentally moved the
..._SCALE and ..._OFFSET bits to the next structure field. That field
was .info_mask_shared_by_type before the _available attributes was added
by commit 51239600074b ("iio:core: add a callback to allow drivers to
provide _available attributes") and .info_mask_separate_available
afterwards, and the regression happened.

info_mask_shared_by_type is actually a better choice than the originally
intended info_mask_separate for the ..._SCALE and ..._OFFSET bits since
a constant is returned from mpl115_read_raw for the scale/offset. Using
info_mask_shared_by_type also preserves the behavior from before the
regression and is therefore less likely to cause other interesting side
effects.

The above mentioned regression causes unintended sysfs attibutes to
show up that are not backed by code, in turn causing a NULL pointer
defererence to happen on access.

Fixes: 3017d90e8931 ("iio: Add Freescale MPL115A2 pressure / temperature sensor driver")
Fixes: 51239600074b ("iio:core: add a callback to allow drivers to provide _available attributes")
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>