Magellan Linux

Annotation of /trunk/kernel-alx-legacy/patches-4.9/0395-4.9.296-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3697 - (hide annotations) (download)
Mon Oct 24 14:08:11 2022 UTC (19 months, 1 week ago) by niro
File size: 9912 byte(s)
-linux-4.9.296
1 niro 3697 diff --git a/Makefile b/Makefile
2     index b5afdb8a75219..1ec880bcdb2d6 100644
3     --- a/Makefile
4     +++ b/Makefile
5     @@ -1,6 +1,6 @@
6     VERSION = 4
7     PATCHLEVEL = 9
8     -SUBLEVEL = 295
9     +SUBLEVEL = 296
10     EXTRAVERSION =
11     NAME = Roaring Lionus
12    
13     diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
14     index 2d2422705ccf7..da9813f09d7d7 100644
15     --- a/drivers/hid/Kconfig
16     +++ b/drivers/hid/Kconfig
17     @@ -136,6 +136,7 @@ config HID_APPLEIR
18    
19     config HID_ASUS
20     tristate "Asus"
21     + depends on USB_HID
22     depends on I2C_HID
23     ---help---
24     Support for Asus notebook built-in keyboard via i2c.
25     diff --git a/drivers/input/joystick/spaceball.c b/drivers/input/joystick/spaceball.c
26     index f4445a4e8d6a5..cfa1be4ad8689 100644
27     --- a/drivers/input/joystick/spaceball.c
28     +++ b/drivers/input/joystick/spaceball.c
29     @@ -35,6 +35,7 @@
30     #include <linux/module.h>
31     #include <linux/input.h>
32     #include <linux/serio.h>
33     +#include <asm/unaligned.h>
34    
35     #define DRIVER_DESC "SpaceTec SpaceBall 2003/3003/4000 FLX driver"
36    
37     @@ -91,9 +92,15 @@ static void spaceball_process_packet(struct spaceball* spaceball)
38    
39     case 'D': /* Ball data */
40     if (spaceball->idx != 15) return;
41     - for (i = 0; i < 6; i++)
42     + /*
43     + * Skip first three bytes; read six axes worth of data.
44     + * Axis values are signed 16-bit big-endian.
45     + */
46     + data += 3;
47     + for (i = 0; i < ARRAY_SIZE(spaceball_axes); i++) {
48     input_report_abs(dev, spaceball_axes[i],
49     - (__s16)((data[2 * i + 3] << 8) | data[2 * i + 2]));
50     + (__s16)get_unaligned_be16(&data[i * 2]));
51     + }
52     break;
53    
54     case 'K': /* Button data */
55     diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
56     index ef234c9b2f2f5..11773838a34d4 100644
57     --- a/drivers/input/mouse/appletouch.c
58     +++ b/drivers/input/mouse/appletouch.c
59     @@ -929,6 +929,8 @@ static int atp_probe(struct usb_interface *iface,
60     set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit);
61     set_bit(BTN_LEFT, input_dev->keybit);
62    
63     + INIT_WORK(&dev->work, atp_reinit);
64     +
65     error = input_register_device(dev->input);
66     if (error)
67     goto err_free_buffer;
68     @@ -936,8 +938,6 @@ static int atp_probe(struct usb_interface *iface,
69     /* save our data pointer in this interface device */
70     usb_set_intfdata(iface, dev);
71    
72     - INIT_WORK(&dev->work, atp_reinit);
73     -
74     return 0;
75    
76     err_free_buffer:
77     diff --git a/drivers/net/ethernet/freescale/fman/fman_port.c b/drivers/net/ethernet/freescale/fman/fman_port.c
78     index 4986f6ba278a3..45ac5cf717ea8 100644
79     --- a/drivers/net/ethernet/freescale/fman/fman_port.c
80     +++ b/drivers/net/ethernet/freescale/fman/fman_port.c
81     @@ -1658,7 +1658,7 @@ static int fman_port_probe(struct platform_device *of_dev)
82     fman = dev_get_drvdata(&fm_pdev->dev);
83     if (!fman) {
84     err = -EINVAL;
85     - goto return_err;
86     + goto put_device;
87     }
88    
89     err = of_property_read_u32(port_node, "cell-index", &val);
90     @@ -1666,7 +1666,7 @@ static int fman_port_probe(struct platform_device *of_dev)
91     dev_err(port->dev, "%s: reading cell-index for %s failed\n",
92     __func__, port_node->full_name);
93     err = -EINVAL;
94     - goto return_err;
95     + goto put_device;
96     }
97     port_id = (u8)val;
98     port->dts_params.id = port_id;
99     @@ -1700,7 +1700,7 @@ static int fman_port_probe(struct platform_device *of_dev)
100     } else {
101     dev_err(port->dev, "%s: Illegal port type\n", __func__);
102     err = -EINVAL;
103     - goto return_err;
104     + goto put_device;
105     }
106    
107     port->dts_params.type = port_type;
108     @@ -1714,7 +1714,7 @@ static int fman_port_probe(struct platform_device *of_dev)
109     dev_err(port->dev, "%s: incorrect qman-channel-id\n",
110     __func__);
111     err = -EINVAL;
112     - goto return_err;
113     + goto put_device;
114     }
115     port->dts_params.qman_channel_id = qman_channel_id;
116     }
117     @@ -1724,7 +1724,7 @@ static int fman_port_probe(struct platform_device *of_dev)
118     dev_err(port->dev, "%s: of_address_to_resource() failed\n",
119     __func__);
120     err = -ENOMEM;
121     - goto return_err;
122     + goto put_device;
123     }
124    
125     port->dts_params.fman = fman;
126     @@ -1749,6 +1749,8 @@ static int fman_port_probe(struct platform_device *of_dev)
127    
128     return 0;
129    
130     +put_device:
131     + put_device(&fm_pdev->dev);
132     return_err:
133     of_node_put(port_node);
134     free_port:
135     diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c
136     index a66be137324c0..76f5703bc4f65 100644
137     --- a/drivers/platform/x86/apple-gmux.c
138     +++ b/drivers/platform/x86/apple-gmux.c
139     @@ -628,7 +628,7 @@ static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
140     }
141    
142     gmux_data->iostart = res->start;
143     - gmux_data->iolen = res->end - res->start;
144     + gmux_data->iolen = resource_size(res);
145    
146     if (gmux_data->iolen < GMUX_MIN_IO_LEN) {
147     pr_err("gmux I/O region too small (%lu < %u)\n",
148     diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c
149     index 4d2172c115c6e..90057c31d01c6 100644
150     --- a/drivers/scsi/vmw_pvscsi.c
151     +++ b/drivers/scsi/vmw_pvscsi.c
152     @@ -581,9 +581,12 @@ static void pvscsi_complete_request(struct pvscsi_adapter *adapter,
153     * Commands like INQUIRY may transfer less data than
154     * requested by the initiator via bufflen. Set residual
155     * count to make upper layer aware of the actual amount
156     - * of data returned.
157     + * of data returned. There are cases when controller
158     + * returns zero dataLen with non zero data - do not set
159     + * residual count in that case.
160     */
161     - scsi_set_resid(cmd, scsi_bufflen(cmd) - e->dataLen);
162     + if (e->dataLen && (e->dataLen < scsi_bufflen(cmd)))
163     + scsi_set_resid(cmd, scsi_bufflen(cmd) - e->dataLen);
164     cmd->result = (DID_OK << 16);
165     break;
166    
167     diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
168     index bcb2daf81b05d..0336392686935 100644
169     --- a/drivers/usb/gadget/function/f_fs.c
170     +++ b/drivers/usb/gadget/function/f_fs.c
171     @@ -1667,11 +1667,15 @@ static void ffs_data_clear(struct ffs_data *ffs)
172    
173     BUG_ON(ffs->gadget);
174    
175     - if (ffs->epfiles)
176     + if (ffs->epfiles) {
177     ffs_epfiles_destroy(ffs->epfiles, ffs->eps_count);
178     + ffs->epfiles = NULL;
179     + }
180    
181     - if (ffs->ffs_eventfd)
182     + if (ffs->ffs_eventfd) {
183     eventfd_ctx_put(ffs->ffs_eventfd);
184     + ffs->ffs_eventfd = NULL;
185     + }
186    
187     kfree(ffs->raw_descs_data);
188     kfree(ffs->raw_strings);
189     @@ -1684,7 +1688,6 @@ static void ffs_data_reset(struct ffs_data *ffs)
190    
191     ffs_data_clear(ffs);
192    
193     - ffs->epfiles = NULL;
194     ffs->raw_descs_data = NULL;
195     ffs->raw_descs = NULL;
196     ffs->raw_strings = NULL;
197     diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
198     index ae67f6383ca32..30c8eeed95074 100644
199     --- a/drivers/usb/host/xhci-pci.c
200     +++ b/drivers/usb/host/xhci-pci.c
201     @@ -92,7 +92,6 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
202     /* Look for vendor-specific quirks */
203     if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC &&
204     (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK ||
205     - pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1100 ||
206     pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1400)) {
207     if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK &&
208     pdev->revision == 0x0) {
209     @@ -127,6 +126,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
210     pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1009)
211     xhci->quirks |= XHCI_BROKEN_STREAMS;
212    
213     + if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC &&
214     + pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1100)
215     + xhci->quirks |= XHCI_TRUST_TX_LENGTH;
216     +
217     if (pdev->vendor == PCI_VENDOR_ID_NEC)
218     xhci->quirks |= XHCI_NEC_HOST;
219    
220     diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h
221     index 399f39ff8048d..1b6d54a328bad 100644
222     --- a/include/uapi/linux/nfc.h
223     +++ b/include/uapi/linux/nfc.h
224     @@ -261,7 +261,7 @@ enum nfc_sdp_attr {
225     #define NFC_SE_ENABLED 0x1
226    
227     struct sockaddr_nfc {
228     - sa_family_t sa_family;
229     + __kernel_sa_family_t sa_family;
230     __u32 dev_idx;
231     __u32 target_idx;
232     __u32 nfc_protocol;
233     @@ -269,14 +269,14 @@ struct sockaddr_nfc {
234    
235     #define NFC_LLCP_MAX_SERVICE_NAME 63
236     struct sockaddr_nfc_llcp {
237     - sa_family_t sa_family;
238     + __kernel_sa_family_t sa_family;
239     __u32 dev_idx;
240     __u32 target_idx;
241     __u32 nfc_protocol;
242     __u8 dsap; /* Destination SAP, if known */
243     __u8 ssap; /* Source SAP to be bound to */
244     char service_name[NFC_LLCP_MAX_SERVICE_NAME]; /* Service name URI */;
245     - size_t service_name_len;
246     + __kernel_size_t service_name_len;
247     };
248    
249     /* NFC socket protocols */
250     diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
251     index 689246d079ad4..a8563745980b4 100644
252     --- a/net/ipv4/af_inet.c
253     +++ b/net/ipv4/af_inet.c
254     @@ -1833,6 +1833,10 @@ static int __init inet_init(void)
255    
256     tcp_v4_init();
257    
258     + /* Initialise per-cpu ipv4 mibs */
259     + if (init_ipv4_mibs())
260     + panic("%s: Cannot init ipv4 mibs\n", __func__);
261     +
262     /* Setup TCP slab cache for open requests. */
263     tcp_init();
264    
265     @@ -1861,12 +1865,6 @@ static int __init inet_init(void)
266    
267     if (init_inet_pernet_ops())
268     pr_crit("%s: Cannot init ipv4 inet pernet ops\n", __func__);
269     - /*
270     - * Initialise per-cpu ipv4 mibs
271     - */
272     -
273     - if (init_ipv4_mibs())
274     - pr_crit("%s: Cannot init ipv4 mibs\n", __func__);
275    
276     ipv4_proc_init();
277    
278     diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
279     index 21da2831e05b4..796174fd90322 100755
280     --- a/scripts/recordmcount.pl
281     +++ b/scripts/recordmcount.pl
282     @@ -250,7 +250,7 @@ if ($arch eq "x86_64") {
283    
284     } elsif ($arch eq "s390" && $bits == 64) {
285     if ($cc =~ /-DCC_USING_HOTPATCH/) {
286     - $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*(bcrl\\s*0,|jgnop\\s*)[0-9a-f]+ <([^\+]*)>\$";
287     + $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*(brcl\\s*0,|jgnop\\s*)[0-9a-f]+ <([^\+]*)>\$";
288     $mcount_adjust = 0;
289     } else {
290     $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$";
291     diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
292     index 607c7fc4f24d3..eb9e2b4e81d92 100644
293     --- a/security/selinux/hooks.c
294     +++ b/security/selinux/hooks.c
295     @@ -5194,7 +5194,7 @@ static unsigned int selinux_ip_postroute_compat(struct sk_buff *skb,
296     struct common_audit_data ad;
297     struct lsm_network_audit net = {0,};
298     char *addrp;
299     - u8 proto;
300     + u8 proto = 0;
301    
302     if (sk == NULL)
303     return NF_ACCEPT;