Skip to content
This repository was archived by the owner on Feb 16, 2024. It is now read-only.

Commit cd370af

Browse files
committed
Merge tag 'v4.14.317' of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux into paradox-rerebase
This is the 4.14.317 stable release Conflicts: drivers/usb/gadget/function/f_fs.c
2 parents e94bd5a + 1914956 commit cd370af

65 files changed

Lines changed: 747 additions & 491 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 4
33
PATCHLEVEL = 14
4-
SUBLEVEL = 316
4+
SUBLEVEL = 317
55
EXTRAVERSION =
66
NAME = Petit Gorille
77

@@ -821,6 +821,10 @@ LDFLAGS += -O3
821821
endif
822822

823823
KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
824+
825+
# These result in bogus false positives
826+
KBUILD_CFLAGS += $(call cc-disable-warning, dangling-pointer)
827+
824828
ifdef CONFIG_FRAME_POINTER
825829
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
826830
else

arch/arm/kernel/unwind.c

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,29 @@ static int unwind_exec_pop_subset_r0_to_r3(struct unwind_ctrl_block *ctrl,
313313
return URC_OK;
314314
}
315315

316+
static unsigned long unwind_decode_uleb128(struct unwind_ctrl_block *ctrl)
317+
{
318+
unsigned long bytes = 0;
319+
unsigned long insn;
320+
unsigned long result = 0;
321+
322+
/*
323+
* unwind_get_byte() will advance `ctrl` one instruction at a time, so
324+
* loop until we get an instruction byte where bit 7 is not set.
325+
*
326+
* Note: This decodes a maximum of 4 bytes to output 28 bits data where
327+
* max is 0xfffffff: that will cover a vsp increment of 1073742336, hence
328+
* it is sufficient for unwinding the stack.
329+
*/
330+
do {
331+
insn = unwind_get_byte(ctrl);
332+
result |= (insn & 0x7f) << (bytes * 7);
333+
bytes++;
334+
} while (!!(insn & 0x80) && (bytes != sizeof(result)));
335+
336+
return result;
337+
}
338+
316339
/*
317340
* Execute the current unwind instruction.
318341
*/
@@ -366,7 +389,7 @@ static int unwind_exec_insn(struct unwind_ctrl_block *ctrl)
366389
if (ret)
367390
goto error;
368391
} else if (insn == 0xb2) {
369-
unsigned long uleb128 = unwind_get_byte(ctrl);
392+
unsigned long uleb128 = unwind_decode_uleb128(ctrl);
370393

371394
ctrl->vrs[SP] += 0x204 + (uleb128 << 2);
372395
} else {

arch/x86/boot/boot.h

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,66 +114,78 @@ typedef unsigned int addr_t;
114114

115115
static inline u8 rdfs8(addr_t addr)
116116
{
117+
u8 *ptr = (u8 *)absolute_pointer(addr);
117118
u8 v;
118-
asm volatile("movb %%fs:%1,%0" : "=q" (v) : "m" (*(u8 *)addr));
119+
asm volatile("movb %%fs:%1,%0" : "=q" (v) : "m" (*ptr));
119120
return v;
120121
}
121122
static inline u16 rdfs16(addr_t addr)
122123
{
124+
u16 *ptr = (u16 *)absolute_pointer(addr);
123125
u16 v;
124-
asm volatile("movw %%fs:%1,%0" : "=r" (v) : "m" (*(u16 *)addr));
126+
asm volatile("movw %%fs:%1,%0" : "=r" (v) : "m" (*ptr));
125127
return v;
126128
}
127129
static inline u32 rdfs32(addr_t addr)
128130
{
131+
u32 *ptr = (u32 *)absolute_pointer(addr);
129132
u32 v;
130-
asm volatile("movl %%fs:%1,%0" : "=r" (v) : "m" (*(u32 *)addr));
133+
asm volatile("movl %%fs:%1,%0" : "=r" (v) : "m" (*ptr));
131134
return v;
132135
}
133136

134137
static inline void wrfs8(u8 v, addr_t addr)
135138
{
136-
asm volatile("movb %1,%%fs:%0" : "+m" (*(u8 *)addr) : "qi" (v));
139+
u8 *ptr = (u8 *)absolute_pointer(addr);
140+
asm volatile("movb %1,%%fs:%0" : "+m" (*ptr) : "qi" (v));
137141
}
138142
static inline void wrfs16(u16 v, addr_t addr)
139143
{
140-
asm volatile("movw %1,%%fs:%0" : "+m" (*(u16 *)addr) : "ri" (v));
144+
u16 *ptr = (u16 *)absolute_pointer(addr);
145+
asm volatile("movw %1,%%fs:%0" : "+m" (*ptr) : "ri" (v));
141146
}
142147
static inline void wrfs32(u32 v, addr_t addr)
143148
{
144-
asm volatile("movl %1,%%fs:%0" : "+m" (*(u32 *)addr) : "ri" (v));
149+
u32 *ptr = (u32 *)absolute_pointer(addr);
150+
asm volatile("movl %1,%%fs:%0" : "+m" (*ptr) : "ri" (v));
145151
}
146152

147153
static inline u8 rdgs8(addr_t addr)
148154
{
155+
u8 *ptr = (u8 *)absolute_pointer(addr);
149156
u8 v;
150-
asm volatile("movb %%gs:%1,%0" : "=q" (v) : "m" (*(u8 *)addr));
157+
asm volatile("movb %%gs:%1,%0" : "=q" (v) : "m" (*ptr));
151158
return v;
152159
}
153160
static inline u16 rdgs16(addr_t addr)
154161
{
162+
u16 *ptr = (u16 *)absolute_pointer(addr);
155163
u16 v;
156-
asm volatile("movw %%gs:%1,%0" : "=r" (v) : "m" (*(u16 *)addr));
164+
asm volatile("movw %%gs:%1,%0" : "=r" (v) : "m" (*ptr));
157165
return v;
158166
}
159167
static inline u32 rdgs32(addr_t addr)
160168
{
169+
u32 *ptr = (u32 *)absolute_pointer(addr);
161170
u32 v;
162-
asm volatile("movl %%gs:%1,%0" : "=r" (v) : "m" (*(u32 *)addr));
171+
asm volatile("movl %%gs:%1,%0" : "=r" (v) : "m" (*ptr));
163172
return v;
164173
}
165174

166175
static inline void wrgs8(u8 v, addr_t addr)
167176
{
168-
asm volatile("movb %1,%%gs:%0" : "+m" (*(u8 *)addr) : "qi" (v));
177+
u8 *ptr = (u8 *)absolute_pointer(addr);
178+
asm volatile("movb %1,%%gs:%0" : "+m" (*ptr) : "qi" (v));
169179
}
170180
static inline void wrgs16(u16 v, addr_t addr)
171181
{
172-
asm volatile("movw %1,%%gs:%0" : "+m" (*(u16 *)addr) : "ri" (v));
182+
u16 *ptr = (u16 *)absolute_pointer(addr);
183+
asm volatile("movw %1,%%gs:%0" : "+m" (*ptr) : "ri" (v));
173184
}
174185
static inline void wrgs32(u32 v, addr_t addr)
175186
{
176-
asm volatile("movl %1,%%gs:%0" : "+m" (*(u32 *)addr) : "ri" (v));
187+
u32 *ptr = (u32 *)absolute_pointer(addr);
188+
asm volatile("movl %1,%%gs:%0" : "+m" (*ptr) : "ri" (v));
177189
}
178190

179191
/* Note: these only return true/false, not a signed return value! */

arch/x86/boot/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static void copy_boot_params(void)
3434
u16 cl_offset;
3535
};
3636
const struct old_cmdline * const oldcmd =
37-
(const struct old_cmdline *)OLD_CL_ADDRESS;
37+
absolute_pointer(OLD_CL_ADDRESS);
3838

3939
BUILD_BUG_ON(sizeof boot_params != 4096);
4040
memcpy(&boot_params.hdr, &hdr, sizeof hdr);

drivers/acpi/thermal.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,8 +1172,6 @@ static int acpi_thermal_resume(struct device *dev)
11721172
return -EINVAL;
11731173

11741174
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) {
1175-
if (!(&tz->trips.active[i]))
1176-
break;
11771175
if (!tz->trips.active[i].flags.valid)
11781176
break;
11791177
tz->trips.active[i].flags.enabled = 1;

drivers/ata/libata-scsi.c

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3054,18 +3054,36 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
30543054
return 0;
30553055
}
30563056

3057-
static struct ata_device *ata_find_dev(struct ata_port *ap, int devno)
3057+
static struct ata_device *ata_find_dev(struct ata_port *ap, unsigned int devno)
30583058
{
3059-
if (!sata_pmp_attached(ap)) {
3060-
if (likely(devno >= 0 &&
3061-
devno < ata_link_max_devices(&ap->link)))
3059+
/*
3060+
* For the non-PMP case, ata_link_max_devices() returns 1 (SATA case),
3061+
* or 2 (IDE master + slave case). However, the former case includes
3062+
* libsas hosted devices which are numbered per scsi host, leading
3063+
* to devno potentially being larger than 0 but with each struct
3064+
* ata_device having its own struct ata_port and struct ata_link.
3065+
* To accommodate these, ignore devno and always use device number 0.
3066+
*/
3067+
if (likely(!sata_pmp_attached(ap))) {
3068+
int link_max_devices = ata_link_max_devices(&ap->link);
3069+
3070+
if (link_max_devices == 1)
3071+
return &ap->link.device[0];
3072+
3073+
if (devno < link_max_devices)
30623074
return &ap->link.device[devno];
3063-
} else {
3064-
if (likely(devno >= 0 &&
3065-
devno < ap->nr_pmp_links))
3066-
return &ap->pmp_link[devno].device[0];
3075+
3076+
return NULL;
30673077
}
30683078

3079+
/*
3080+
* For PMP-attached devices, the device number corresponds to C
3081+
* (channel) of SCSI [H:C:I:L], indicating the port pmp link
3082+
* for the device.
3083+
*/
3084+
if (devno < ap->nr_pmp_links)
3085+
return &ap->pmp_link[devno].device[0];
3086+
30693087
return NULL;
30703088
}
30713089

drivers/block/nbd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@ static int nbd_dev_dbg_init(struct nbd_device *nbd)
15311531
return -EIO;
15321532

15331533
dir = debugfs_create_dir(nbd_name(nbd), nbd_dbg_dir);
1534-
if (!dir) {
1534+
if (IS_ERR(dir)) {
15351535
dev_err(nbd_to_dev(nbd), "Failed to create debugfs dir for '%s'\n",
15361536
nbd_name(nbd));
15371537
return -EIO;
@@ -1557,7 +1557,7 @@ static int nbd_dbg_init(void)
15571557
struct dentry *dbg_dir;
15581558

15591559
dbg_dir = debugfs_create_dir("nbd", NULL);
1560-
if (!dbg_dir)
1560+
if (IS_ERR(dbg_dir))
15611561
return -EIO;
15621562

15631563
nbd_dbg_dir = dbg_dir;

drivers/dma/pl330.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ static bool _trigger(struct pl330_thread *thrd)
10411041
return true;
10421042
}
10431043

1044-
static bool _start(struct pl330_thread *thrd)
1044+
static bool pl330_start_thread(struct pl330_thread *thrd)
10451045
{
10461046
switch (_state(thrd)) {
10471047
case PL330_STATE_FAULT_COMPLETING:
@@ -1584,7 +1584,7 @@ static int pl330_update(struct pl330_dmac *pl330)
15841584
thrd->req_running = -1;
15851585

15861586
/* Get going again ASAP */
1587-
_start(thrd);
1587+
pl330_start_thread(thrd);
15881588

15891589
/* For now, just make a list of callbacks to be done */
15901590
list_add_tail(&descdone->rqd, &pl330->req_done);
@@ -1974,7 +1974,7 @@ static void pl330_tasklet(unsigned long data)
19741974
} else {
19751975
/* Make sure the PL330 Channel thread is active */
19761976
spin_lock(&pch->thread->dmac->lock);
1977-
_start(pch->thread);
1977+
pl330_start_thread(pch->thread);
19781978
spin_unlock(&pch->thread->dmac->lock);
19791979
}
19801980

@@ -1992,7 +1992,7 @@ static void pl330_tasklet(unsigned long data)
19921992
if (power_down) {
19931993
pch->active = true;
19941994
spin_lock(&pch->thread->dmac->lock);
1995-
_start(pch->thread);
1995+
pl330_start_thread(pch->thread);
19961996
spin_unlock(&pch->thread->dmac->lock);
19971997
power_down = false;
19981998
}

drivers/hid/wacom_wac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
743743
/* Enter report */
744744
if ((data[1] & 0xfc) == 0xc0) {
745745
/* serial number of the tool */
746-
wacom->serial[idx] = ((data[3] & 0x0f) << 28) +
746+
wacom->serial[idx] = ((__u64)(data[3] & 0x0f) << 28) +
747747
(data[4] << 20) + (data[5] << 12) +
748748
(data[6] << 4) + (data[7] >> 4);
749749

drivers/iio/adc/mxs-lradc-adc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -769,13 +769,13 @@ static int mxs_lradc_adc_probe(struct platform_device *pdev)
769769

770770
ret = mxs_lradc_adc_trigger_init(iio);
771771
if (ret)
772-
goto err_trig;
772+
return ret;
773773

774774
ret = iio_triggered_buffer_setup(iio, &iio_pollfunc_store_time,
775775
&mxs_lradc_adc_trigger_handler,
776776
&mxs_lradc_adc_buffer_ops);
777777
if (ret)
778-
return ret;
778+
goto err_trig;
779779

780780
adc->vref_mv = mxs_lradc_adc_vref_mv[lradc->soc];
781781

@@ -813,9 +813,9 @@ static int mxs_lradc_adc_probe(struct platform_device *pdev)
813813

814814
err_dev:
815815
mxs_lradc_adc_hw_stop(adc);
816-
mxs_lradc_adc_trigger_remove(iio);
817-
err_trig:
818816
iio_triggered_buffer_cleanup(iio);
817+
err_trig:
818+
mxs_lradc_adc_trigger_remove(iio);
819819
return ret;
820820
}
821821

@@ -826,8 +826,8 @@ static int mxs_lradc_adc_remove(struct platform_device *pdev)
826826

827827
iio_device_unregister(iio);
828828
mxs_lradc_adc_hw_stop(adc);
829-
mxs_lradc_adc_trigger_remove(iio);
830829
iio_triggered_buffer_cleanup(iio);
830+
mxs_lradc_adc_trigger_remove(iio);
831831

832832
return 0;
833833
}

0 commit comments

Comments
 (0)