1 |
commit: 70818bb3e84ee1fea0fe40220eb71a2f9af81bb6 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Apr 27 11:38:31 2022 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Apr 27 11:38:31 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=70818bb3 |
7 |
|
8 |
Linux patch 4.9.312 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1311_linux-4.9.312.patch | 450 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 454 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 26dfe77a..9590ee57 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -1287,6 +1287,10 @@ Patch: 1310_linux-4.9.311.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 4.9.311 |
23 |
|
24 |
+Patch: 1311_linux-4.9.312.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 4.9.312 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1311_linux-4.9.312.patch b/1311_linux-4.9.312.patch |
33 |
new file mode 100644 |
34 |
index 00000000..fe2e29a4 |
35 |
--- /dev/null |
36 |
+++ b/1311_linux-4.9.312.patch |
37 |
@@ -0,0 +1,450 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index c1a20e4a2d136..a9f16c9c9614f 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,6 +1,6 @@ |
43 |
+ VERSION = 4 |
44 |
+ PATCHLEVEL = 9 |
45 |
+-SUBLEVEL = 311 |
46 |
++SUBLEVEL = 312 |
47 |
+ EXTRAVERSION = |
48 |
+ NAME = Roaring Lionus |
49 |
+ |
50 |
+diff --git a/arch/arc/kernel/entry.S b/arch/arc/kernel/entry.S |
51 |
+index 37ad245cf9899..fb458623f3860 100644 |
52 |
+--- a/arch/arc/kernel/entry.S |
53 |
++++ b/arch/arc/kernel/entry.S |
54 |
+@@ -191,6 +191,7 @@ tracesys_exit: |
55 |
+ st r0, [sp, PT_r0] ; sys call return value in pt_regs |
56 |
+ |
57 |
+ ;POST Sys Call Ptrace Hook |
58 |
++ mov r0, sp ; pt_regs needed |
59 |
+ bl @syscall_trace_exit |
60 |
+ b ret_from_exception ; NOT ret_from_system_call at is saves r0 which |
61 |
+ ; we'd done before calling post hook above |
62 |
+diff --git a/arch/arm/mach-vexpress/spc.c b/arch/arm/mach-vexpress/spc.c |
63 |
+index 635b0d5494874..c16f396140032 100644 |
64 |
+--- a/arch/arm/mach-vexpress/spc.c |
65 |
++++ b/arch/arm/mach-vexpress/spc.c |
66 |
+@@ -584,7 +584,7 @@ static int __init ve_spc_clk_init(void) |
67 |
+ } |
68 |
+ |
69 |
+ cluster = topology_physical_package_id(cpu_dev->id); |
70 |
+- if (init_opp_table[cluster]) |
71 |
++ if (cluster < 0 || init_opp_table[cluster]) |
72 |
+ continue; |
73 |
+ |
74 |
+ if (ve_init_opp_table(cpu_dev)) |
75 |
+diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c |
76 |
+index b6e5447d563ee..f538bac4ac66a 100644 |
77 |
+--- a/block/compat_ioctl.c |
78 |
++++ b/block/compat_ioctl.c |
79 |
+@@ -394,7 +394,7 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg) |
80 |
+ return 0; |
81 |
+ case BLKGETSIZE: |
82 |
+ size = i_size_read(bdev->bd_inode); |
83 |
+- if ((size >> 9) > ~0UL) |
84 |
++ if ((size >> 9) > ~(compat_ulong_t)0) |
85 |
+ return -EFBIG; |
86 |
+ return compat_put_ulong(arg, size >> 9); |
87 |
+ |
88 |
+diff --git a/drivers/ata/pata_marvell.c b/drivers/ata/pata_marvell.c |
89 |
+index ff468a6fd8ddc..677f582cf3d6c 100644 |
90 |
+--- a/drivers/ata/pata_marvell.c |
91 |
++++ b/drivers/ata/pata_marvell.c |
92 |
+@@ -82,6 +82,8 @@ static int marvell_cable_detect(struct ata_port *ap) |
93 |
+ switch(ap->port_no) |
94 |
+ { |
95 |
+ case 0: |
96 |
++ if (!ap->ioaddr.bmdma_addr) |
97 |
++ return ATA_CBL_PATA_UNK; |
98 |
+ if (ioread8(ap->ioaddr.bmdma_addr + 1) & 1) |
99 |
+ return ATA_CBL_PATA40; |
100 |
+ return ATA_CBL_PATA80; |
101 |
+diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c |
102 |
+index c15ca560fe60d..ca266fcca186c 100644 |
103 |
+--- a/drivers/dma/at_xdmac.c |
104 |
++++ b/drivers/dma/at_xdmac.c |
105 |
+@@ -1392,7 +1392,7 @@ at_xdmac_tx_status(struct dma_chan *chan, dma_cookie_t cookie, |
106 |
+ { |
107 |
+ struct at_xdmac_chan *atchan = to_at_xdmac_chan(chan); |
108 |
+ struct at_xdmac *atxdmac = to_at_xdmac(atchan->chan.device); |
109 |
+- struct at_xdmac_desc *desc, *_desc; |
110 |
++ struct at_xdmac_desc *desc, *_desc, *iter; |
111 |
+ struct list_head *descs_list; |
112 |
+ enum dma_status ret; |
113 |
+ int residue, retry; |
114 |
+@@ -1507,11 +1507,13 @@ at_xdmac_tx_status(struct dma_chan *chan, dma_cookie_t cookie, |
115 |
+ * microblock. |
116 |
+ */ |
117 |
+ descs_list = &desc->descs_list; |
118 |
+- list_for_each_entry_safe(desc, _desc, descs_list, desc_node) { |
119 |
+- dwidth = at_xdmac_get_dwidth(desc->lld.mbr_cfg); |
120 |
+- residue -= (desc->lld.mbr_ubc & 0xffffff) << dwidth; |
121 |
+- if ((desc->lld.mbr_nda & 0xfffffffc) == cur_nda) |
122 |
++ list_for_each_entry_safe(iter, _desc, descs_list, desc_node) { |
123 |
++ dwidth = at_xdmac_get_dwidth(iter->lld.mbr_cfg); |
124 |
++ residue -= (iter->lld.mbr_ubc & 0xffffff) << dwidth; |
125 |
++ if ((iter->lld.mbr_nda & 0xfffffffc) == cur_nda) { |
126 |
++ desc = iter; |
127 |
+ break; |
128 |
++ } |
129 |
+ } |
130 |
+ residue += cur_ubc << dwidth; |
131 |
+ |
132 |
+diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c |
133 |
+index 558d509b7d855..4337cf9defc24 100644 |
134 |
+--- a/drivers/dma/imx-sdma.c |
135 |
++++ b/drivers/dma/imx-sdma.c |
136 |
+@@ -1528,7 +1528,7 @@ static int sdma_event_remap(struct sdma_engine *sdma) |
137 |
+ u32 reg, val, shift, num_map, i; |
138 |
+ int ret = 0; |
139 |
+ |
140 |
+- if (IS_ERR(np) || IS_ERR(gpr_np)) |
141 |
++ if (IS_ERR(np) || !gpr_np) |
142 |
+ goto out; |
143 |
+ |
144 |
+ event_remap = of_find_property(np, propname, NULL); |
145 |
+@@ -1576,7 +1576,7 @@ static int sdma_event_remap(struct sdma_engine *sdma) |
146 |
+ } |
147 |
+ |
148 |
+ out: |
149 |
+- if (!IS_ERR(gpr_np)) |
150 |
++ if (gpr_np) |
151 |
+ of_node_put(gpr_np); |
152 |
+ |
153 |
+ return ret; |
154 |
+diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c |
155 |
+index 83bf997dda03c..e14bfbdbaf2bf 100644 |
156 |
+--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c |
157 |
++++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c |
158 |
+@@ -192,7 +192,10 @@ static void mdp5_plane_reset(struct drm_plane *plane) |
159 |
+ drm_framebuffer_unreference(plane->state->fb); |
160 |
+ |
161 |
+ kfree(to_mdp5_plane_state(plane->state)); |
162 |
++ plane->state = NULL; |
163 |
+ mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL); |
164 |
++ if (!mdp5_state) |
165 |
++ return; |
166 |
+ |
167 |
+ /* assign default blend parameters */ |
168 |
+ mdp5_state->alpha = 255; |
169 |
+diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c |
170 |
+index 500016209ae0c..3ed40bde796b7 100644 |
171 |
+--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c |
172 |
++++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c |
173 |
+@@ -1010,8 +1010,8 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link) |
174 |
+ { |
175 |
+ u32 reg = link << (E1000_LTRV_REQ_SHIFT + E1000_LTRV_NOSNOOP_SHIFT) | |
176 |
+ link << E1000_LTRV_REQ_SHIFT | E1000_LTRV_SEND; |
177 |
+- u16 max_ltr_enc_d = 0; /* maximum LTR decoded by platform */ |
178 |
+- u16 lat_enc_d = 0; /* latency decoded */ |
179 |
++ u32 max_ltr_enc_d = 0; /* maximum LTR decoded by platform */ |
180 |
++ u32 lat_enc_d = 0; /* latency decoded */ |
181 |
+ u16 lat_enc = 0; /* latency encoded */ |
182 |
+ |
183 |
+ if (link) { |
184 |
+diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c |
185 |
+index 0bfadec8b79c9..d59cb381e80b1 100644 |
186 |
+--- a/drivers/net/vxlan.c |
187 |
++++ b/drivers/net/vxlan.c |
188 |
+@@ -490,11 +490,11 @@ static int vxlan_fdb_append(struct vxlan_fdb *f, |
189 |
+ |
190 |
+ rd = kmalloc(sizeof(*rd), GFP_ATOMIC); |
191 |
+ if (rd == NULL) |
192 |
+- return -ENOBUFS; |
193 |
++ return -ENOMEM; |
194 |
+ |
195 |
+ if (dst_cache_init(&rd->dst_cache, GFP_ATOMIC)) { |
196 |
+ kfree(rd); |
197 |
+- return -ENOBUFS; |
198 |
++ return -ENOMEM; |
199 |
+ } |
200 |
+ |
201 |
+ rd->remote_ip = *ip; |
202 |
+diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c |
203 |
+index 998a4bd6db78a..d8f34883c0960 100644 |
204 |
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c |
205 |
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c |
206 |
+@@ -547,7 +547,7 @@ enum brcmf_sdio_frmtype { |
207 |
+ BRCMF_SDIO_FT_SUB, |
208 |
+ }; |
209 |
+ |
210 |
+-#define SDIOD_DRVSTR_KEY(chip, pmu) (((chip) << 16) | (pmu)) |
211 |
++#define SDIOD_DRVSTR_KEY(chip, pmu) (((unsigned int)(chip) << 16) | (pmu)) |
212 |
+ |
213 |
+ /* SDIO Pad drive strength to select value mappings */ |
214 |
+ struct sdiod_drive_str { |
215 |
+diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c |
216 |
+index 8c146e2b6727a..4664d3e191c81 100644 |
217 |
+--- a/drivers/platform/x86/samsung-laptop.c |
218 |
++++ b/drivers/platform/x86/samsung-laptop.c |
219 |
+@@ -1125,8 +1125,6 @@ static void kbd_led_set(struct led_classdev *led_cdev, |
220 |
+ |
221 |
+ if (value > samsung->kbd_led.max_brightness) |
222 |
+ value = samsung->kbd_led.max_brightness; |
223 |
+- else if (value < 0) |
224 |
+- value = 0; |
225 |
+ |
226 |
+ samsung->kbd_led_wk = value; |
227 |
+ queue_work(samsung->led_workqueue, &samsung->kbd_led_work); |
228 |
+diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c |
229 |
+index 95e4f074b7665..b85c283ad08b3 100644 |
230 |
+--- a/fs/cifs/cifsfs.c |
231 |
++++ b/fs/cifs/cifsfs.c |
232 |
+@@ -766,7 +766,7 @@ cifs_loose_read_iter(struct kiocb *iocb, struct iov_iter *iter) |
233 |
+ ssize_t rc; |
234 |
+ struct inode *inode = file_inode(iocb->ki_filp); |
235 |
+ |
236 |
+- if (iocb->ki_filp->f_flags & O_DIRECT) |
237 |
++ if (iocb->ki_flags & IOCB_DIRECT) |
238 |
+ return cifs_user_readv(iocb, iter); |
239 |
+ |
240 |
+ rc = cifs_revalidate_mapping(inode); |
241 |
+diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c |
242 |
+index e66aa8918dee2..754b33828853d 100644 |
243 |
+--- a/fs/ext4/inode.c |
244 |
++++ b/fs/ext4/inode.c |
245 |
+@@ -3980,7 +3980,8 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length) |
246 |
+ struct super_block *sb = inode->i_sb; |
247 |
+ ext4_lblk_t first_block, stop_block; |
248 |
+ struct address_space *mapping = inode->i_mapping; |
249 |
+- loff_t first_block_offset, last_block_offset; |
250 |
++ loff_t first_block_offset, last_block_offset, max_length; |
251 |
++ struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); |
252 |
+ handle_t *handle; |
253 |
+ unsigned int credits; |
254 |
+ int ret = 0; |
255 |
+@@ -4026,6 +4027,14 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length) |
256 |
+ offset; |
257 |
+ } |
258 |
+ |
259 |
++ /* |
260 |
++ * For punch hole the length + offset needs to be within one block |
261 |
++ * before last range. Adjust the length if it goes beyond that limit. |
262 |
++ */ |
263 |
++ max_length = sbi->s_bitmap_maxbytes - inode->i_sb->s_blocksize; |
264 |
++ if (offset + length > max_length) |
265 |
++ length = max_length - offset; |
266 |
++ |
267 |
+ if (offset & (sb->s_blocksize - 1) || |
268 |
+ (offset + length) & (sb->s_blocksize - 1)) { |
269 |
+ /* |
270 |
+diff --git a/fs/ext4/super.c b/fs/ext4/super.c |
271 |
+index e17a6396bde6c..c50ba683a570a 100644 |
272 |
+--- a/fs/ext4/super.c |
273 |
++++ b/fs/ext4/super.c |
274 |
+@@ -3241,9 +3241,11 @@ static int count_overhead(struct super_block *sb, ext4_group_t grp, |
275 |
+ ext4_fsblk_t first_block, last_block, b; |
276 |
+ ext4_group_t i, ngroups = ext4_get_groups_count(sb); |
277 |
+ int s, j, count = 0; |
278 |
++ int has_super = ext4_bg_has_super(sb, grp); |
279 |
+ |
280 |
+ if (!ext4_has_feature_bigalloc(sb)) |
281 |
+- return (ext4_bg_has_super(sb, grp) + ext4_bg_num_gdb(sb, grp) + |
282 |
++ return (has_super + ext4_bg_num_gdb(sb, grp) + |
283 |
++ (has_super ? le16_to_cpu(sbi->s_es->s_reserved_gdt_blocks) : 0) + |
284 |
+ sbi->s_itb_per_group + 2); |
285 |
+ |
286 |
+ first_block = le32_to_cpu(sbi->s_es->s_first_data_block) + |
287 |
+@@ -4162,9 +4164,18 @@ no_journal: |
288 |
+ * Get the # of file system overhead blocks from the |
289 |
+ * superblock if present. |
290 |
+ */ |
291 |
+- if (es->s_overhead_clusters) |
292 |
+- sbi->s_overhead = le32_to_cpu(es->s_overhead_clusters); |
293 |
+- else { |
294 |
++ sbi->s_overhead = le32_to_cpu(es->s_overhead_clusters); |
295 |
++ /* ignore the precalculated value if it is ridiculous */ |
296 |
++ if (sbi->s_overhead > ext4_blocks_count(es)) |
297 |
++ sbi->s_overhead = 0; |
298 |
++ /* |
299 |
++ * If the bigalloc feature is not enabled recalculating the |
300 |
++ * overhead doesn't take long, so we might as well just redo |
301 |
++ * it to make sure we are using the correct value. |
302 |
++ */ |
303 |
++ if (!ext4_has_feature_bigalloc(sb)) |
304 |
++ sbi->s_overhead = 0; |
305 |
++ if (sbi->s_overhead == 0) { |
306 |
+ err = ext4_calculate_overhead(sb); |
307 |
+ if (err) |
308 |
+ goto failed_mount_wq; |
309 |
+diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c |
310 |
+index a4182b150bb07..9f83a4c602f99 100644 |
311 |
+--- a/fs/gfs2/rgrp.c |
312 |
++++ b/fs/gfs2/rgrp.c |
313 |
+@@ -917,15 +917,15 @@ static int read_rindex_entry(struct gfs2_inode *ip) |
314 |
+ rgd->rd_bitbytes = be32_to_cpu(buf.ri_bitbytes); |
315 |
+ spin_lock_init(&rgd->rd_rsspin); |
316 |
+ |
317 |
+- error = compute_bitstructs(rgd); |
318 |
+- if (error) |
319 |
+- goto fail; |
320 |
+- |
321 |
+ error = gfs2_glock_get(sdp, rgd->rd_addr, |
322 |
+ &gfs2_rgrp_glops, CREATE, &rgd->rd_gl); |
323 |
+ if (error) |
324 |
+ goto fail; |
325 |
+ |
326 |
++ error = compute_bitstructs(rgd); |
327 |
++ if (error) |
328 |
++ goto fail_glock; |
329 |
++ |
330 |
+ rgd->rd_rgl = (struct gfs2_rgrp_lvb *)rgd->rd_gl->gl_lksb.sb_lvbptr; |
331 |
+ rgd->rd_flags &= ~(GFS2_RDF_UPTODATE | GFS2_RDF_PREFERRED); |
332 |
+ if (rgd->rd_data > sdp->sd_max_rg_data) |
333 |
+@@ -942,6 +942,7 @@ static int read_rindex_entry(struct gfs2_inode *ip) |
334 |
+ } |
335 |
+ |
336 |
+ error = 0; /* someone else read in the rgrp; free it and ignore it */ |
337 |
++fail_glock: |
338 |
+ gfs2_glock_put(rgd->rd_gl); |
339 |
+ |
340 |
+ fail: |
341 |
+diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h |
342 |
+index 6fec9e81bd70d..1979298fdca9e 100644 |
343 |
+--- a/include/linux/etherdevice.h |
344 |
++++ b/include/linux/etherdevice.h |
345 |
+@@ -125,7 +125,7 @@ static inline bool is_multicast_ether_addr(const u8 *addr) |
346 |
+ #endif |
347 |
+ } |
348 |
+ |
349 |
+-static inline bool is_multicast_ether_addr_64bits(const u8 addr[6+2]) |
350 |
++static inline bool is_multicast_ether_addr_64bits(const u8 *addr) |
351 |
+ { |
352 |
+ #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 |
353 |
+ #ifdef __BIG_ENDIAN |
354 |
+@@ -339,8 +339,7 @@ static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2) |
355 |
+ * Please note that alignment of addr1 & addr2 are only guaranteed to be 16 bits. |
356 |
+ */ |
357 |
+ |
358 |
+-static inline bool ether_addr_equal_64bits(const u8 addr1[6+2], |
359 |
+- const u8 addr2[6+2]) |
360 |
++static inline bool ether_addr_equal_64bits(const u8 *addr1, const u8 *addr2) |
361 |
+ { |
362 |
+ #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 |
363 |
+ u64 fold = (*(const u64 *)addr1) ^ (*(const u64 *)addr2); |
364 |
+diff --git a/mm/page_alloc.c b/mm/page_alloc.c |
365 |
+index 25c21aa398f8c..a6e682569e5b9 100644 |
366 |
+--- a/mm/page_alloc.c |
367 |
++++ b/mm/page_alloc.c |
368 |
+@@ -6504,7 +6504,7 @@ void __init mem_init_print_info(const char *str) |
369 |
+ */ |
370 |
+ #define adj_init_size(start, end, size, pos, adj) \ |
371 |
+ do { \ |
372 |
+- if (start <= pos && pos < end && size > adj) \ |
373 |
++ if (&start[0] <= &pos[0] && &pos[0] < &end[0] && size > adj) \ |
374 |
+ size -= adj; \ |
375 |
+ } while (0) |
376 |
+ |
377 |
+diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c |
378 |
+index 8aef475fef310..a8674e9ff37b7 100644 |
379 |
+--- a/net/netlink/af_netlink.c |
380 |
++++ b/net/netlink/af_netlink.c |
381 |
+@@ -2194,6 +2194,13 @@ static int netlink_dump(struct sock *sk) |
382 |
+ * single netdev. The outcome is MSG_TRUNC error. |
383 |
+ */ |
384 |
+ skb_reserve(skb, skb_tailroom(skb) - alloc_size); |
385 |
++ |
386 |
++ /* Make sure malicious BPF programs can not read unitialized memory |
387 |
++ * from skb->head -> skb->data |
388 |
++ */ |
389 |
++ skb_reset_network_header(skb); |
390 |
++ skb_reset_mac_header(skb); |
391 |
++ |
392 |
+ netlink_skb_set_owner_r(skb, sk); |
393 |
+ |
394 |
+ if (nlk->dump_done_errno > 0) |
395 |
+diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c |
396 |
+index 28471cfad9225..26921f755f3a9 100644 |
397 |
+--- a/net/openvswitch/flow_netlink.c |
398 |
++++ b/net/openvswitch/flow_netlink.c |
399 |
+@@ -1863,7 +1863,7 @@ static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa, |
400 |
+ new_acts_size = max(next_offset + req_size, ksize(*sfa) * 2); |
401 |
+ |
402 |
+ if (new_acts_size > MAX_ACTIONS_BUFSIZE) { |
403 |
+- if ((MAX_ACTIONS_BUFSIZE - next_offset) < req_size) { |
404 |
++ if ((next_offset + req_size) > MAX_ACTIONS_BUFSIZE) { |
405 |
+ OVS_NLERR(log, "Flow action size exceeds max %u", |
406 |
+ MAX_ACTIONS_BUFSIZE); |
407 |
+ return ERR_PTR(-EMSGSIZE); |
408 |
+diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c |
409 |
+index e79d6881a97eb..2ae2801dd7bee 100644 |
410 |
+--- a/net/packet/af_packet.c |
411 |
++++ b/net/packet/af_packet.c |
412 |
+@@ -2808,8 +2808,9 @@ tpacket_error: |
413 |
+ |
414 |
+ status = TP_STATUS_SEND_REQUEST; |
415 |
+ err = po->xmit(skb); |
416 |
+- if (unlikely(err > 0)) { |
417 |
+- err = net_xmit_errno(err); |
418 |
++ if (unlikely(err != 0)) { |
419 |
++ if (err > 0) |
420 |
++ err = net_xmit_errno(err); |
421 |
+ if (err && __packet_get_status(po, ph) == |
422 |
+ TP_STATUS_AVAILABLE) { |
423 |
+ /* skb was destructed already */ |
424 |
+@@ -3009,8 +3010,12 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) |
425 |
+ skb->no_fcs = 1; |
426 |
+ |
427 |
+ err = po->xmit(skb); |
428 |
+- if (err > 0 && (err = net_xmit_errno(err)) != 0) |
429 |
+- goto out_unlock; |
430 |
++ if (unlikely(err != 0)) { |
431 |
++ if (err > 0) |
432 |
++ err = net_xmit_errno(err); |
433 |
++ if (err) |
434 |
++ goto out_unlock; |
435 |
++ } |
436 |
+ |
437 |
+ dev_put(dev); |
438 |
+ |
439 |
+diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c |
440 |
+index 21b0368c2a3bc..878a4fc97f042 100644 |
441 |
+--- a/sound/soc/soc-dapm.c |
442 |
++++ b/sound/soc/soc-dapm.c |
443 |
+@@ -1569,8 +1569,7 @@ static void dapm_seq_run(struct snd_soc_card *card, |
444 |
+ switch (w->id) { |
445 |
+ case snd_soc_dapm_pre: |
446 |
+ if (!w->event) |
447 |
+- list_for_each_entry_safe_continue(w, n, list, |
448 |
+- power_list); |
449 |
++ continue; |
450 |
+ |
451 |
+ if (event == SND_SOC_DAPM_STREAM_START) |
452 |
+ ret = w->event(w, |
453 |
+@@ -1582,8 +1581,7 @@ static void dapm_seq_run(struct snd_soc_card *card, |
454 |
+ |
455 |
+ case snd_soc_dapm_post: |
456 |
+ if (!w->event) |
457 |
+- list_for_each_entry_safe_continue(w, n, list, |
458 |
+- power_list); |
459 |
++ continue; |
460 |
+ |
461 |
+ if (event == SND_SOC_DAPM_STREAM_START) |
462 |
+ ret = w->event(w, |
463 |
+diff --git a/sound/usb/midi.c b/sound/usb/midi.c |
464 |
+index f0b41fee71304..83da676519a8d 100644 |
465 |
+--- a/sound/usb/midi.c |
466 |
++++ b/sound/usb/midi.c |
467 |
+@@ -1210,6 +1210,7 @@ static void snd_usbmidi_output_drain(struct snd_rawmidi_substream *substream) |
468 |
+ } while (drain_urbs && timeout); |
469 |
+ finish_wait(&ep->drain_wait, &wait); |
470 |
+ } |
471 |
++ port->active = 0; |
472 |
+ spin_unlock_irq(&ep->buffer_lock); |
473 |
+ } |
474 |
+ |
475 |
+diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h |
476 |
+index 62456a806bb4d..4b8f1c46420d4 100644 |
477 |
+--- a/sound/usb/usbaudio.h |
478 |
++++ b/sound/usb/usbaudio.h |
479 |
+@@ -22,7 +22,7 @@ |
480 |
+ */ |
481 |
+ |
482 |
+ /* handling of USB vendor/product ID pairs as 32-bit numbers */ |
483 |
+-#define USB_ID(vendor, product) (((vendor) << 16) | (product)) |
484 |
++#define USB_ID(vendor, product) (((unsigned int)(vendor) << 16) | (product)) |
485 |
+ #define USB_ID_VENDOR(id) ((id) >> 16) |
486 |
+ #define USB_ID_PRODUCT(id) ((u16)(id)) |
487 |
+ |