From d8850568bc431e367acdfdd354461b3c41362cba Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 5 Jul 2020 23:38:57 -0400 Subject: [PATCH] Fixes for 4.19 Signed-off-by: Sasha Levin --- ...ueue-dump-destination-buffer-context.patch | 54 +++ ...tc-u32-key-values-and-masks-natively.patch | 348 ++++++++++++++++++ ...t-type-for-all-mask-ip-address-compa.patch | 56 +++ ...ned-conversion-for-fetching-timestam.patch | 39 ++ ...error-return-code-in-dpu_encoder_ini.patch | 36 ++ ...-sun4i-hdmi-remove-extra-hpd-polling.patch | 50 +++ ..._meter-fix-potential-memory-leak-in-.patch | 47 +++ ...ke-sure-the-overt-mask-is-set-correc.patch | 67 ++++ ...-0x78-as-scl-stuck-low-status-for-pc.patch | 43 +++ ...k-correct-size-of-maximum-recv_len-p.patch | 42 +++ ...e-fix-a-crash-in-nvme_mpath_add_disk.patch | 44 +++ queue-4.19/series | 13 + ...onor-posix-flag-for-multiuser-mounts.patch | 51 +++ ...vblk-vqs-in-error-path-of-virtblk_pr.patch | 36 ++ 14 files changed, 926 insertions(+) create mode 100644 queue-4.19/cxgb4-fix-sge-queue-dump-destination-buffer-context.patch create mode 100644 queue-4.19/cxgb4-parse-tc-u32-key-values-and-masks-natively.patch create mode 100644 queue-4.19/cxgb4-use-correct-type-for-all-mask-ip-address-compa.patch create mode 100644 queue-4.19/cxgb4-use-unaligned-conversion-for-fetching-timestam.patch create mode 100644 queue-4.19/drm-msm-dpu-fix-error-return-code-in-dpu_encoder_ini.patch create mode 100644 queue-4.19/drm-sun4i-hdmi-remove-extra-hpd-polling.patch create mode 100644 queue-4.19/hwmon-acpi_power_meter-fix-potential-memory-leak-in-.patch create mode 100644 queue-4.19/hwmon-max6697-make-sure-the-overt-mask-is-set-correc.patch create mode 100644 queue-4.19/i2c-algo-pca-add-0x78-as-scl-stuck-low-status-for-pc.patch create mode 100644 queue-4.19/i2c-mlxcpld-check-correct-size-of-maximum-recv_len-p.patch create mode 100644 queue-4.19/nvme-fix-a-crash-in-nvme_mpath_add_disk.patch create mode 100644 queue-4.19/smb3-honor-posix-flag-for-multiuser-mounts.patch create mode 100644 queue-4.19/virtio-blk-free-vblk-vqs-in-error-path-of-virtblk_pr.patch diff --git a/queue-4.19/cxgb4-fix-sge-queue-dump-destination-buffer-context.patch b/queue-4.19/cxgb4-fix-sge-queue-dump-destination-buffer-context.patch new file mode 100644 index 00000000000..c0db1bf2730 --- /dev/null +++ b/queue-4.19/cxgb4-fix-sge-queue-dump-destination-buffer-context.patch @@ -0,0 +1,54 @@ +From 16353aa5acbc1b3024039565a61357933701bdf7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 24 Jun 2020 01:51:37 +0530 +Subject: cxgb4: fix SGE queue dump destination buffer context + +From: Rahul Lakkireddy + +[ Upstream commit 1992ded5d111997877a9a25205976d8d03c46814 ] + +The data in destination buffer is expected to be be parsed in big +endian. So, use the right context. + +Fixes following sparse warning: +cudbg_lib.c:2041:44: warning: incorrect type in assignment (different +base types) +cudbg_lib.c:2041:44: expected unsigned long long [usertype] +cudbg_lib.c:2041:44: got restricted __be64 [usertype] + +Fixes: 736c3b94474e ("cxgb4: collect egress and ingress SGE queue contexts") +Signed-off-by: Rahul Lakkireddy +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +index 5bc58429bb1c4..c91e155c147ca 100644 +--- a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c ++++ b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +@@ -1987,7 +1987,6 @@ int cudbg_collect_dump_context(struct cudbg_init *pdbg_init, + u8 mem_type[CTXT_INGRESS + 1] = { 0 }; + struct cudbg_buffer temp_buff = { 0 }; + struct cudbg_ch_cntxt *buff; +- u64 *dst_off, *src_off; + u8 *ctx_buf; + u8 i, k; + int rc; +@@ -2056,8 +2055,11 @@ int cudbg_collect_dump_context(struct cudbg_init *pdbg_init, + } + + for (j = 0; j < max_ctx_qid; j++) { ++ __be64 *dst_off; ++ u64 *src_off; ++ + src_off = (u64 *)(ctx_buf + j * SGE_CTXT_SIZE); +- dst_off = (u64 *)buff->data; ++ dst_off = (__be64 *)buff->data; + + /* The data is stored in 64-bit cpu order. Convert it + * to big endian before parsing. +-- +2.25.1 + diff --git a/queue-4.19/cxgb4-parse-tc-u32-key-values-and-masks-natively.patch b/queue-4.19/cxgb4-parse-tc-u32-key-values-and-masks-natively.patch new file mode 100644 index 00000000000..7ded5ea7f02 --- /dev/null +++ b/queue-4.19/cxgb4-parse-tc-u32-key-values-and-masks-natively.patch @@ -0,0 +1,348 @@ +From 5df4697ef3f90898020f1bec5a48a396126e2129 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 24 Jun 2020 01:51:34 +0530 +Subject: cxgb4: parse TC-U32 key values and masks natively + +From: Rahul Lakkireddy + +[ Upstream commit 27f78cb245abdb86735529c13b0a579f57829e71 ] + +TC-U32 passes all keys values and masks in __be32 format. The parser +already expects this and hence pass the value and masks in __be32 +natively to the parser. + +Fixes following sparse warnings in several places: +cxgb4_tc_u32.c:57:21: warning: incorrect type in assignment (different base +types) +cxgb4_tc_u32.c:57:21: expected unsigned int [usertype] val +cxgb4_tc_u32.c:57:21: got restricted __be32 [usertype] val +cxgb4_tc_u32_parse.h:48:24: warning: cast to restricted __be32 + +Fixes: 2e8aad7bf203 ("cxgb4: add parser to translate u32 filters to internal spec") +Signed-off-by: Rahul Lakkireddy +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + .../net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c | 18 +-- + .../chelsio/cxgb4/cxgb4_tc_u32_parse.h | 122 ++++++++++++------ + 2 files changed, 91 insertions(+), 49 deletions(-) + +diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c +index c7d2b4dc7568e..9fd0acd1cbd17 100644 +--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c ++++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c +@@ -47,7 +47,7 @@ static int fill_match_fields(struct adapter *adap, + bool next_header) + { + unsigned int i, j; +- u32 val, mask; ++ __be32 val, mask; + int off, err; + bool found; + +@@ -216,7 +216,7 @@ int cxgb4_config_knode(struct net_device *dev, struct tc_cls_u32_offload *cls) + const struct cxgb4_next_header *next; + bool found = false; + unsigned int i, j; +- u32 val, mask; ++ __be32 val, mask; + int off; + + if (t->table[link_uhtid - 1].link_handle) { +@@ -230,10 +230,10 @@ int cxgb4_config_knode(struct net_device *dev, struct tc_cls_u32_offload *cls) + + /* Try to find matches that allow jumps to next header. */ + for (i = 0; next[i].jump; i++) { +- if (next[i].offoff != cls->knode.sel->offoff || +- next[i].shift != cls->knode.sel->offshift || +- next[i].mask != cls->knode.sel->offmask || +- next[i].offset != cls->knode.sel->off) ++ if (next[i].sel.offoff != cls->knode.sel->offoff || ++ next[i].sel.offshift != cls->knode.sel->offshift || ++ next[i].sel.offmask != cls->knode.sel->offmask || ++ next[i].sel.off != cls->knode.sel->off) + continue; + + /* Found a possible candidate. Find a key that +@@ -245,9 +245,9 @@ int cxgb4_config_knode(struct net_device *dev, struct tc_cls_u32_offload *cls) + val = cls->knode.sel->keys[j].val; + mask = cls->knode.sel->keys[j].mask; + +- if (next[i].match_off == off && +- next[i].match_val == val && +- next[i].match_mask == mask) { ++ if (next[i].key.off == off && ++ next[i].key.val == val && ++ next[i].key.mask == mask) { + found = true; + break; + } +diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h +index a4b99edcc3399..141085e159e57 100644 +--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h ++++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h +@@ -38,12 +38,12 @@ + struct cxgb4_match_field { + int off; /* Offset from the beginning of the header to match */ + /* Fill the value/mask pair in the spec if matched */ +- int (*val)(struct ch_filter_specification *f, u32 val, u32 mask); ++ int (*val)(struct ch_filter_specification *f, __be32 val, __be32 mask); + }; + + /* IPv4 match fields */ + static inline int cxgb4_fill_ipv4_tos(struct ch_filter_specification *f, +- u32 val, u32 mask) ++ __be32 val, __be32 mask) + { + f->val.tos = (ntohl(val) >> 16) & 0x000000FF; + f->mask.tos = (ntohl(mask) >> 16) & 0x000000FF; +@@ -52,7 +52,7 @@ static inline int cxgb4_fill_ipv4_tos(struct ch_filter_specification *f, + } + + static inline int cxgb4_fill_ipv4_frag(struct ch_filter_specification *f, +- u32 val, u32 mask) ++ __be32 val, __be32 mask) + { + u32 mask_val; + u8 frag_val; +@@ -74,7 +74,7 @@ static inline int cxgb4_fill_ipv4_frag(struct ch_filter_specification *f, + } + + static inline int cxgb4_fill_ipv4_proto(struct ch_filter_specification *f, +- u32 val, u32 mask) ++ __be32 val, __be32 mask) + { + f->val.proto = (ntohl(val) >> 16) & 0x000000FF; + f->mask.proto = (ntohl(mask) >> 16) & 0x000000FF; +@@ -83,7 +83,7 @@ static inline int cxgb4_fill_ipv4_proto(struct ch_filter_specification *f, + } + + static inline int cxgb4_fill_ipv4_src_ip(struct ch_filter_specification *f, +- u32 val, u32 mask) ++ __be32 val, __be32 mask) + { + memcpy(&f->val.fip[0], &val, sizeof(u32)); + memcpy(&f->mask.fip[0], &mask, sizeof(u32)); +@@ -92,7 +92,7 @@ static inline int cxgb4_fill_ipv4_src_ip(struct ch_filter_specification *f, + } + + static inline int cxgb4_fill_ipv4_dst_ip(struct ch_filter_specification *f, +- u32 val, u32 mask) ++ __be32 val, __be32 mask) + { + memcpy(&f->val.lip[0], &val, sizeof(u32)); + memcpy(&f->mask.lip[0], &mask, sizeof(u32)); +@@ -111,7 +111,7 @@ static const struct cxgb4_match_field cxgb4_ipv4_fields[] = { + + /* IPv6 match fields */ + static inline int cxgb4_fill_ipv6_tos(struct ch_filter_specification *f, +- u32 val, u32 mask) ++ __be32 val, __be32 mask) + { + f->val.tos = (ntohl(val) >> 20) & 0x000000FF; + f->mask.tos = (ntohl(mask) >> 20) & 0x000000FF; +@@ -120,7 +120,7 @@ static inline int cxgb4_fill_ipv6_tos(struct ch_filter_specification *f, + } + + static inline int cxgb4_fill_ipv6_proto(struct ch_filter_specification *f, +- u32 val, u32 mask) ++ __be32 val, __be32 mask) + { + f->val.proto = (ntohl(val) >> 8) & 0x000000FF; + f->mask.proto = (ntohl(mask) >> 8) & 0x000000FF; +@@ -129,7 +129,7 @@ static inline int cxgb4_fill_ipv6_proto(struct ch_filter_specification *f, + } + + static inline int cxgb4_fill_ipv6_src_ip0(struct ch_filter_specification *f, +- u32 val, u32 mask) ++ __be32 val, __be32 mask) + { + memcpy(&f->val.fip[0], &val, sizeof(u32)); + memcpy(&f->mask.fip[0], &mask, sizeof(u32)); +@@ -138,7 +138,7 @@ static inline int cxgb4_fill_ipv6_src_ip0(struct ch_filter_specification *f, + } + + static inline int cxgb4_fill_ipv6_src_ip1(struct ch_filter_specification *f, +- u32 val, u32 mask) ++ __be32 val, __be32 mask) + { + memcpy(&f->val.fip[4], &val, sizeof(u32)); + memcpy(&f->mask.fip[4], &mask, sizeof(u32)); +@@ -147,7 +147,7 @@ static inline int cxgb4_fill_ipv6_src_ip1(struct ch_filter_specification *f, + } + + static inline int cxgb4_fill_ipv6_src_ip2(struct ch_filter_specification *f, +- u32 val, u32 mask) ++ __be32 val, __be32 mask) + { + memcpy(&f->val.fip[8], &val, sizeof(u32)); + memcpy(&f->mask.fip[8], &mask, sizeof(u32)); +@@ -156,7 +156,7 @@ static inline int cxgb4_fill_ipv6_src_ip2(struct ch_filter_specification *f, + } + + static inline int cxgb4_fill_ipv6_src_ip3(struct ch_filter_specification *f, +- u32 val, u32 mask) ++ __be32 val, __be32 mask) + { + memcpy(&f->val.fip[12], &val, sizeof(u32)); + memcpy(&f->mask.fip[12], &mask, sizeof(u32)); +@@ -165,7 +165,7 @@ static inline int cxgb4_fill_ipv6_src_ip3(struct ch_filter_specification *f, + } + + static inline int cxgb4_fill_ipv6_dst_ip0(struct ch_filter_specification *f, +- u32 val, u32 mask) ++ __be32 val, __be32 mask) + { + memcpy(&f->val.lip[0], &val, sizeof(u32)); + memcpy(&f->mask.lip[0], &mask, sizeof(u32)); +@@ -174,7 +174,7 @@ static inline int cxgb4_fill_ipv6_dst_ip0(struct ch_filter_specification *f, + } + + static inline int cxgb4_fill_ipv6_dst_ip1(struct ch_filter_specification *f, +- u32 val, u32 mask) ++ __be32 val, __be32 mask) + { + memcpy(&f->val.lip[4], &val, sizeof(u32)); + memcpy(&f->mask.lip[4], &mask, sizeof(u32)); +@@ -183,7 +183,7 @@ static inline int cxgb4_fill_ipv6_dst_ip1(struct ch_filter_specification *f, + } + + static inline int cxgb4_fill_ipv6_dst_ip2(struct ch_filter_specification *f, +- u32 val, u32 mask) ++ __be32 val, __be32 mask) + { + memcpy(&f->val.lip[8], &val, sizeof(u32)); + memcpy(&f->mask.lip[8], &mask, sizeof(u32)); +@@ -192,7 +192,7 @@ static inline int cxgb4_fill_ipv6_dst_ip2(struct ch_filter_specification *f, + } + + static inline int cxgb4_fill_ipv6_dst_ip3(struct ch_filter_specification *f, +- u32 val, u32 mask) ++ __be32 val, __be32 mask) + { + memcpy(&f->val.lip[12], &val, sizeof(u32)); + memcpy(&f->mask.lip[12], &mask, sizeof(u32)); +@@ -216,7 +216,7 @@ static const struct cxgb4_match_field cxgb4_ipv6_fields[] = { + + /* TCP/UDP match */ + static inline int cxgb4_fill_l4_ports(struct ch_filter_specification *f, +- u32 val, u32 mask) ++ __be32 val, __be32 mask) + { + f->val.fport = ntohl(val) >> 16; + f->mask.fport = ntohl(mask) >> 16; +@@ -237,19 +237,13 @@ static const struct cxgb4_match_field cxgb4_udp_fields[] = { + }; + + struct cxgb4_next_header { +- unsigned int offset; /* Offset to next header */ +- /* offset, shift, and mask added to offset above ++ /* Offset, shift, and mask added to beginning of the header + * to get to next header. Useful when using a header + * field's value to jump to next header such as IHL field + * in IPv4 header. + */ +- unsigned int offoff; +- u32 shift; +- u32 mask; +- /* match criteria to make this jump */ +- unsigned int match_off; +- u32 match_val; +- u32 match_mask; ++ struct tc_u32_sel sel; ++ struct tc_u32_key key; + /* location of jump to make */ + const struct cxgb4_match_field *jump; + }; +@@ -258,26 +252,74 @@ struct cxgb4_next_header { + * IPv4 header. + */ + static const struct cxgb4_next_header cxgb4_ipv4_jumps[] = { +- { .offset = 0, .offoff = 0, .shift = 6, .mask = 0xF, +- .match_off = 8, .match_val = 0x600, .match_mask = 0xFF00, +- .jump = cxgb4_tcp_fields }, +- { .offset = 0, .offoff = 0, .shift = 6, .mask = 0xF, +- .match_off = 8, .match_val = 0x1100, .match_mask = 0xFF00, +- .jump = cxgb4_udp_fields }, +- { .jump = NULL } ++ { ++ /* TCP Jump */ ++ .sel = { ++ .off = 0, ++ .offoff = 0, ++ .offshift = 6, ++ .offmask = cpu_to_be16(0x0f00), ++ }, ++ .key = { ++ .off = 8, ++ .val = cpu_to_be32(0x00060000), ++ .mask = cpu_to_be32(0x00ff0000), ++ }, ++ .jump = cxgb4_tcp_fields, ++ }, ++ { ++ /* UDP Jump */ ++ .sel = { ++ .off = 0, ++ .offoff = 0, ++ .offshift = 6, ++ .offmask = cpu_to_be16(0x0f00), ++ }, ++ .key = { ++ .off = 8, ++ .val = cpu_to_be32(0x00110000), ++ .mask = cpu_to_be32(0x00ff0000), ++ }, ++ .jump = cxgb4_udp_fields, ++ }, ++ { .jump = NULL }, + }; + + /* Accept a rule with a jump directly past the 40 Bytes of IPv6 fixed header + * to get to transport layer header. + */ + static const struct cxgb4_next_header cxgb4_ipv6_jumps[] = { +- { .offset = 0x28, .offoff = 0, .shift = 0, .mask = 0, +- .match_off = 4, .match_val = 0x60000, .match_mask = 0xFF0000, +- .jump = cxgb4_tcp_fields }, +- { .offset = 0x28, .offoff = 0, .shift = 0, .mask = 0, +- .match_off = 4, .match_val = 0x110000, .match_mask = 0xFF0000, +- .jump = cxgb4_udp_fields }, +- { .jump = NULL } ++ { ++ /* TCP Jump */ ++ .sel = { ++ .off = 40, ++ .offoff = 0, ++ .offshift = 0, ++ .offmask = 0, ++ }, ++ .key = { ++ .off = 4, ++ .val = cpu_to_be32(0x00000600), ++ .mask = cpu_to_be32(0x0000ff00), ++ }, ++ .jump = cxgb4_tcp_fields, ++ }, ++ { ++ /* UDP Jump */ ++ .sel = { ++ .off = 40, ++ .offoff = 0, ++ .offshift = 0, ++ .offmask = 0, ++ }, ++ .key = { ++ .off = 4, ++ .val = cpu_to_be32(0x00001100), ++ .mask = cpu_to_be32(0x0000ff00), ++ }, ++ .jump = cxgb4_udp_fields, ++ }, ++ { .jump = NULL }, + }; + + struct cxgb4_link { +-- +2.25.1 + diff --git a/queue-4.19/cxgb4-use-correct-type-for-all-mask-ip-address-compa.patch b/queue-4.19/cxgb4-use-correct-type-for-all-mask-ip-address-compa.patch new file mode 100644 index 00000000000..25e5c85b8e5 --- /dev/null +++ b/queue-4.19/cxgb4-use-correct-type-for-all-mask-ip-address-compa.patch @@ -0,0 +1,56 @@ +From 44fac69d2809a813bdbd5ff2b4eb7d45b490770f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 24 Jun 2020 01:51:36 +0530 +Subject: cxgb4: use correct type for all-mask IP address comparison + +From: Rahul Lakkireddy + +[ Upstream commit f286dd8eaad5a2758750f407ab079298e0bcc8a5 ] + +Use correct type to check for all-mask exact match IP addresses. + +Fixes following sparse warnings due to big endian value checks +against 0xffffffff in is_addr_all_mask(): +cxgb4_filter.c:977:25: warning: restricted __be32 degrades to integer +cxgb4_filter.c:983:37: warning: restricted __be32 degrades to integer +cxgb4_filter.c:984:37: warning: restricted __be32 degrades to integer +cxgb4_filter.c:985:37: warning: restricted __be32 degrades to integer +cxgb4_filter.c:986:37: warning: restricted __be32 degrades to integer + +Fixes: 3eb8b62d5a26 ("cxgb4: add support to create hash-filters via tc-flower offload") +Signed-off-by: Rahul Lakkireddy +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c +index 7dddb9e748b81..86745f33a252d 100644 +--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c ++++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c +@@ -810,16 +810,16 @@ static bool is_addr_all_mask(u8 *ipmask, int family) + struct in_addr *addr; + + addr = (struct in_addr *)ipmask; +- if (addr->s_addr == 0xffffffff) ++ if (ntohl(addr->s_addr) == 0xffffffff) + return true; + } else if (family == AF_INET6) { + struct in6_addr *addr6; + + addr6 = (struct in6_addr *)ipmask; +- if (addr6->s6_addr32[0] == 0xffffffff && +- addr6->s6_addr32[1] == 0xffffffff && +- addr6->s6_addr32[2] == 0xffffffff && +- addr6->s6_addr32[3] == 0xffffffff) ++ if (ntohl(addr6->s6_addr32[0]) == 0xffffffff && ++ ntohl(addr6->s6_addr32[1]) == 0xffffffff && ++ ntohl(addr6->s6_addr32[2]) == 0xffffffff && ++ ntohl(addr6->s6_addr32[3]) == 0xffffffff) + return true; + } + return false; +-- +2.25.1 + diff --git a/queue-4.19/cxgb4-use-unaligned-conversion-for-fetching-timestam.patch b/queue-4.19/cxgb4-use-unaligned-conversion-for-fetching-timestam.patch new file mode 100644 index 00000000000..99683915379 --- /dev/null +++ b/queue-4.19/cxgb4-use-unaligned-conversion-for-fetching-timestam.patch @@ -0,0 +1,39 @@ +From 623340e9478a169cbb005eca67c43930ccc28670 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 24 Jun 2020 01:51:33 +0530 +Subject: cxgb4: use unaligned conversion for fetching timestamp + +From: Rahul Lakkireddy + +[ Upstream commit 589b1c9c166dce120e27b32a83a78f55464a7ef9 ] + +Use get_unaligned_be64() to fetch the timestamp needed for ns_to_ktime() +conversion. + +Fixes following sparse warning: +sge.c:3282:43: warning: cast to restricted __be64 + +Fixes: a456950445a0 ("cxgb4: time stamping interface for PTP") +Signed-off-by: Rahul Lakkireddy +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/chelsio/cxgb4/sge.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c +index 6807bc3a44fb7..3d4a765e9e61d 100644 +--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c ++++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c +@@ -2742,7 +2742,7 @@ static noinline int t4_systim_to_hwstamp(struct adapter *adapter, + + hwtstamps = skb_hwtstamps(skb); + memset(hwtstamps, 0, sizeof(*hwtstamps)); +- hwtstamps->hwtstamp = ns_to_ktime(be64_to_cpu(*((u64 *)data))); ++ hwtstamps->hwtstamp = ns_to_ktime(get_unaligned_be64(data)); + + return RX_PTP_PKT_SUC; + } +-- +2.25.1 + diff --git a/queue-4.19/drm-msm-dpu-fix-error-return-code-in-dpu_encoder_ini.patch b/queue-4.19/drm-msm-dpu-fix-error-return-code-in-dpu_encoder_ini.patch new file mode 100644 index 00000000000..f1e4386eca7 --- /dev/null +++ b/queue-4.19/drm-msm-dpu-fix-error-return-code-in-dpu_encoder_ini.patch @@ -0,0 +1,36 @@ +From 7ae03489e73641e1effa34f3141ad18fca01f66a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Jun 2020 09:48:59 +0800 +Subject: drm/msm/dpu: fix error return code in dpu_encoder_init + +From: Chen Tao + +[ Upstream commit aa472721c8dbe1713cf510f56ffbc56ae9e14247 ] + +Fix to return negative error code -ENOMEM with the use of +ERR_PTR from dpu_encoder_init. + +Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") +Signed-off-by: Chen Tao +Signed-off-by: Rob Clark +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +index ec3fd67378c18..19e2753ffe07c 100644 +--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c ++++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +@@ -2412,7 +2412,7 @@ struct drm_encoder *dpu_encoder_init(struct drm_device *dev, + + dpu_enc = devm_kzalloc(dev->dev, sizeof(*dpu_enc), GFP_KERNEL); + if (!dpu_enc) +- return ERR_PTR(ENOMEM); ++ return ERR_PTR(-ENOMEM); + + rc = drm_encoder_init(dev, &dpu_enc->base, &dpu_encoder_funcs, + drm_enc_mode, NULL); +-- +2.25.1 + diff --git a/queue-4.19/drm-sun4i-hdmi-remove-extra-hpd-polling.patch b/queue-4.19/drm-sun4i-hdmi-remove-extra-hpd-polling.patch new file mode 100644 index 00000000000..11fb5d5de5a --- /dev/null +++ b/queue-4.19/drm-sun4i-hdmi-remove-extra-hpd-polling.patch @@ -0,0 +1,50 @@ +From 2dabf878bc29c8e06c1467160731c5a3e46ea458 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 29 Jun 2020 14:00:32 +0800 +Subject: drm: sun4i: hdmi: Remove extra HPD polling + +From: Chen-Yu Tsai + +[ Upstream commit bda8eaa6dee7525f4dac950810a85a88bf6c2ba0 ] + +The HPD sense mechanism in Allwinner's old HDMI encoder hardware is more +or less an input-only GPIO. Other GPIO-based HPD implementations +directly return the current state, instead of polling for a specific +state and returning the other if that times out. + +Remove the I/O polling from sun4i_hdmi_connector_detect() and directly +return a known state based on the current reading. This also gets rid +of excessive CPU usage by kworker as reported on Stack Exchange [1] and +Armbian forums [2]. + + [1] https://superuser.com/questions/1515001/debian-10-buster-on-cubietruck-with-bug-in-sun4i-drm-hdmi + [2] https://forum.armbian.com/topic/14282-headless-systems-and-sun4i_drm_hdmi-a10a20/ + +Fixes: 9c5681011a0c ("drm/sun4i: Add HDMI support") +Signed-off-by: Chen-Yu Tsai +Signed-off-by: Maxime Ripard +Link: https://patchwork.freedesktop.org/patch/msgid/20200629060032.24134-1-wens@kernel.org +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +index 8ad36f574df8c..7e7fa8cef2ade 100644 +--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c ++++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +@@ -242,9 +242,8 @@ sun4i_hdmi_connector_detect(struct drm_connector *connector, bool force) + struct sun4i_hdmi *hdmi = drm_connector_to_sun4i_hdmi(connector); + unsigned long reg; + +- if (readl_poll_timeout(hdmi->base + SUN4I_HDMI_HPD_REG, reg, +- reg & SUN4I_HDMI_HPD_HIGH, +- 0, 500000)) { ++ reg = readl(hdmi->base + SUN4I_HDMI_HPD_REG); ++ if (reg & SUN4I_HDMI_HPD_HIGH) { + cec_phys_addr_invalidate(hdmi->cec_adap); + return connector_status_disconnected; + } +-- +2.25.1 + diff --git a/queue-4.19/hwmon-acpi_power_meter-fix-potential-memory-leak-in-.patch b/queue-4.19/hwmon-acpi_power_meter-fix-potential-memory-leak-in-.patch new file mode 100644 index 00000000000..2bbe28b2281 --- /dev/null +++ b/queue-4.19/hwmon-acpi_power_meter-fix-potential-memory-leak-in-.patch @@ -0,0 +1,47 @@ +From 65e1a75bf2827f94b55cf20f2e462800fa3a0048 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 25 Jun 2020 13:32:42 +0900 +Subject: hwmon: (acpi_power_meter) Fix potential memory leak in + acpi_power_meter_add() + +From: Misono Tomohiro + +[ Upstream commit 8b97f9922211c44a739c5cbd9502ecbb9f17f6d1 ] + +Although it rarely happens, we should call free_capabilities() +if error happens after read_capabilities() to free allocated strings. + +Fixes: de584afa5e188 ("hwmon driver for ACPI 4.0 power meters") +Signed-off-by: Misono Tomohiro +Link: https://lore.kernel.org/r/20200625043242.31175-1-misono.tomohiro@jp.fujitsu.com +Signed-off-by: Guenter Roeck +Signed-off-by: Sasha Levin +--- + drivers/hwmon/acpi_power_meter.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c +index 2f2fb19669580..2f40da04a9445 100644 +--- a/drivers/hwmon/acpi_power_meter.c ++++ b/drivers/hwmon/acpi_power_meter.c +@@ -896,7 +896,7 @@ static int acpi_power_meter_add(struct acpi_device *device) + + res = setup_attrs(resource); + if (res) +- goto exit_free; ++ goto exit_free_capability; + + resource->hwmon_dev = hwmon_device_register(&device->dev); + if (IS_ERR(resource->hwmon_dev)) { +@@ -909,6 +909,8 @@ static int acpi_power_meter_add(struct acpi_device *device) + + exit_remove: + remove_attrs(resource); ++exit_free_capability: ++ free_capabilities(resource); + exit_free: + kfree(resource); + exit: +-- +2.25.1 + diff --git a/queue-4.19/hwmon-max6697-make-sure-the-overt-mask-is-set-correc.patch b/queue-4.19/hwmon-max6697-make-sure-the-overt-mask-is-set-correc.patch new file mode 100644 index 00000000000..42a8f782954 --- /dev/null +++ b/queue-4.19/hwmon-max6697-make-sure-the-overt-mask-is-set-correc.patch @@ -0,0 +1,67 @@ +From e808c0f9629a216690dd8f1baa960b90f80c30b2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 23 Jun 2020 22:13:08 +0000 +Subject: hwmon: (max6697) Make sure the OVERT mask is set correctly + +From: Chu Lin + +[ Upstream commit 016983d138cbe99a5c0aaae0103ee88f5300beb3 ] + +Per the datasheet for max6697, OVERT mask and ALERT mask are different. +For example, the 7th bit of OVERT is the local channel but for alert +mask, the 6th bit is the local channel. Therefore, we can't apply the +same mask for both registers. In addition to that, the max6697 driver +is supposed to be compatibale with different models. I manually went over +all the listed chips and made sure all chip types have the same layout. + +Testing; + mask value of 0x9 should map to 0x44 for ALERT and 0x84 for OVERT. + I used iotool to read the reg value back to verify. I only tested this + change on max6581. + +Reference: +https://datasheets.maximintegrated.com/en/ds/MAX6581.pdf +https://datasheets.maximintegrated.com/en/ds/MAX6697.pdf +https://datasheets.maximintegrated.com/en/ds/MAX6699.pdf + +Signed-off-by: Chu Lin +Fixes: 5372d2d71c46e ("hwmon: Driver for Maxim MAX6697 and compatibles") +Signed-off-by: Guenter Roeck +Signed-off-by: Sasha Levin +--- + drivers/hwmon/max6697.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/hwmon/max6697.c b/drivers/hwmon/max6697.c +index 221fd14920576..6df28fe0577da 100644 +--- a/drivers/hwmon/max6697.c ++++ b/drivers/hwmon/max6697.c +@@ -47,8 +47,9 @@ static const u8 MAX6697_REG_CRIT[] = { + * Map device tree / platform data register bit map to chip bit map. + * Applies to alert register and over-temperature register. + */ +-#define MAX6697_MAP_BITS(reg) ((((reg) & 0x7e) >> 1) | \ ++#define MAX6697_ALERT_MAP_BITS(reg) ((((reg) & 0x7e) >> 1) | \ + (((reg) & 0x01) << 6) | ((reg) & 0x80)) ++#define MAX6697_OVERT_MAP_BITS(reg) (((reg) >> 1) | (((reg) & 0x01) << 7)) + + #define MAX6697_REG_STAT(n) (0x44 + (n)) + +@@ -587,12 +588,12 @@ static int max6697_init_chip(struct max6697_data *data, + return ret; + + ret = i2c_smbus_write_byte_data(client, MAX6697_REG_ALERT_MASK, +- MAX6697_MAP_BITS(pdata->alert_mask)); ++ MAX6697_ALERT_MAP_BITS(pdata->alert_mask)); + if (ret < 0) + return ret; + + ret = i2c_smbus_write_byte_data(client, MAX6697_REG_OVERT_MASK, +- MAX6697_MAP_BITS(pdata->over_temperature_mask)); ++ MAX6697_OVERT_MAP_BITS(pdata->over_temperature_mask)); + if (ret < 0) + return ret; + +-- +2.25.1 + diff --git a/queue-4.19/i2c-algo-pca-add-0x78-as-scl-stuck-low-status-for-pc.patch b/queue-4.19/i2c-algo-pca-add-0x78-as-scl-stuck-low-status-for-pc.patch new file mode 100644 index 00000000000..1f733816097 --- /dev/null +++ b/queue-4.19/i2c-algo-pca-add-0x78-as-scl-stuck-low-status-for-pc.patch @@ -0,0 +1,43 @@ +From 1b7c9d077e1e333cecefe445b4768e02a52602a4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 2 Jul 2020 10:39:11 +1200 +Subject: i2c: algo-pca: Add 0x78 as SCL stuck low status for PCA9665 + +From: Chris Packham + +[ Upstream commit cd217f2300793a106b49c7dfcbfb26e348bc7593 ] + +The PCA9665 datasheet says that I2CSTA = 78h indicates that SCL is stuck +low, this differs to the PCA9564 which uses 90h for this indication. +Treat either 0x78 or 0x90 as an indication that the SCL line is stuck. + +Based on looking through the PCA9564 and PCA9665 datasheets this should +be safe for both chips. The PCA9564 should not return 0x78 for any valid +state and the PCA9665 should not return 0x90. + +Fixes: eff9ec95efaa ("i2c-algo-pca: Add PCA9665 support") +Signed-off-by: Chris Packham +Reviewed-by: Andy Shevchenko +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + drivers/i2c/algos/i2c-algo-pca.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c +index 883a290f6a4d0..0e745f82d6a53 100644 +--- a/drivers/i2c/algos/i2c-algo-pca.c ++++ b/drivers/i2c/algos/i2c-algo-pca.c +@@ -323,7 +323,8 @@ static int pca_xfer(struct i2c_adapter *i2c_adap, + DEB2("BUS ERROR - SDA Stuck low\n"); + pca_reset(adap); + goto out; +- case 0x90: /* Bus error - SCL stuck low */ ++ case 0x78: /* Bus error - SCL stuck low (PCA9665) */ ++ case 0x90: /* Bus error - SCL stuck low (PCA9564) */ + DEB2("BUS ERROR - SCL Stuck low\n"); + pca_reset(adap); + goto out; +-- +2.25.1 + diff --git a/queue-4.19/i2c-mlxcpld-check-correct-size-of-maximum-recv_len-p.patch b/queue-4.19/i2c-mlxcpld-check-correct-size-of-maximum-recv_len-p.patch new file mode 100644 index 00000000000..9b38044ad71 --- /dev/null +++ b/queue-4.19/i2c-mlxcpld-check-correct-size-of-maximum-recv_len-p.patch @@ -0,0 +1,42 @@ +From ac4fa5237bf97f316c52c54ac039cfe713dce3f4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 28 Jun 2020 13:52:44 +0200 +Subject: i2c: mlxcpld: check correct size of maximum RECV_LEN packet + +From: Wolfram Sang + +[ Upstream commit 597911287fcd13c3a4b4aa3e0a52b33d431e0a8e ] + +I2C_SMBUS_BLOCK_MAX defines already the maximum number as defined in the +SMBus 2.0 specs. I don't see a reason to add 1 here. Also, fix the errno +to what is suggested for this error. + +Fixes: c9bfdc7c16cb ("i2c: mlxcpld: Add support for smbus block read transaction") +Signed-off-by: Wolfram Sang +Reviewed-by: Michael Shych +Tested-by: Michael Shych +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-mlxcpld.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-mlxcpld.c b/drivers/i2c/busses/i2c-mlxcpld.c +index 2fd717d8dd30e..71d7bae2cbcad 100644 +--- a/drivers/i2c/busses/i2c-mlxcpld.c ++++ b/drivers/i2c/busses/i2c-mlxcpld.c +@@ -337,9 +337,9 @@ static int mlxcpld_i2c_wait_for_tc(struct mlxcpld_i2c_priv *priv) + if (priv->smbus_block && (val & MLXCPLD_I2C_SMBUS_BLK_BIT)) { + mlxcpld_i2c_read_comm(priv, MLXCPLD_LPCI2C_NUM_DAT_REG, + &datalen, 1); +- if (unlikely(datalen > (I2C_SMBUS_BLOCK_MAX + 1))) { ++ if (unlikely(datalen > I2C_SMBUS_BLOCK_MAX)) { + dev_err(priv->dev, "Incorrect smbus block read message len\n"); +- return -E2BIG; ++ return -EPROTO; + } + } else { + datalen = priv->xfer.data_len; +-- +2.25.1 + diff --git a/queue-4.19/nvme-fix-a-crash-in-nvme_mpath_add_disk.patch b/queue-4.19/nvme-fix-a-crash-in-nvme_mpath_add_disk.patch new file mode 100644 index 00000000000..d48ed4bfdc2 --- /dev/null +++ b/queue-4.19/nvme-fix-a-crash-in-nvme_mpath_add_disk.patch @@ -0,0 +1,44 @@ +From 5534764b766a0820f3e6365ecea217a5459105ad Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 29 Jun 2020 16:30:19 +0200 +Subject: nvme: fix a crash in nvme_mpath_add_disk + +From: Christoph Hellwig + +[ Upstream commit 72d447113bb751ded97b2e2c38f886e4a4139082 ] + +For private namespaces ns->head_disk is NULL, so add a NULL check +before updating the BDI capabilities. + +Fixes: b2ce4d90690b ("nvme-multipath: set bdi capabilities once") +Reported-by: Avinash M N +Signed-off-by: Christoph Hellwig +Reviewed-by: Sagi Grimberg +Reviewed-by: Max Gurtovoy +Signed-off-by: Sasha Levin +--- + drivers/nvme/host/multipath.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c +index 3ad6183c5e6b4..2e63c1106030b 100644 +--- a/drivers/nvme/host/multipath.c ++++ b/drivers/nvme/host/multipath.c +@@ -532,10 +532,11 @@ void nvme_mpath_add_disk(struct nvme_ns *ns, struct nvme_id_ns *id) + } + + if (bdi_cap_stable_pages_required(ns->queue->backing_dev_info)) { +- struct backing_dev_info *info = +- ns->head->disk->queue->backing_dev_info; ++ struct gendisk *disk = ns->head->disk; + +- info->capabilities |= BDI_CAP_STABLE_WRITES; ++ if (disk) ++ disk->queue->backing_dev_info->capabilities |= ++ BDI_CAP_STABLE_WRITES; + } + } + +-- +2.25.1 + diff --git a/queue-4.19/series b/queue-4.19/series index dc4eb2fa45a..0b01f6d404d 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -12,3 +12,16 @@ nvme-multipath-fix-deadlock-between-ana_work-and-sca.patch kgdb-avoid-suspicious-rcu-usage-warning.patch tpm_tis-remove-the-hid-ifx0102.patch crypto-af_alg-fix-use-after-free-in-af_alg_accept-due-to-bh_lock_sock.patch +drm-msm-dpu-fix-error-return-code-in-dpu_encoder_ini.patch +cxgb4-use-unaligned-conversion-for-fetching-timestam.patch +cxgb4-parse-tc-u32-key-values-and-masks-natively.patch +cxgb4-use-correct-type-for-all-mask-ip-address-compa.patch +cxgb4-fix-sge-queue-dump-destination-buffer-context.patch +hwmon-max6697-make-sure-the-overt-mask-is-set-correc.patch +hwmon-acpi_power_meter-fix-potential-memory-leak-in-.patch +drm-sun4i-hdmi-remove-extra-hpd-polling.patch +virtio-blk-free-vblk-vqs-in-error-path-of-virtblk_pr.patch +smb3-honor-posix-flag-for-multiuser-mounts.patch +nvme-fix-a-crash-in-nvme_mpath_add_disk.patch +i2c-algo-pca-add-0x78-as-scl-stuck-low-status-for-pc.patch +i2c-mlxcpld-check-correct-size-of-maximum-recv_len-p.patch diff --git a/queue-4.19/smb3-honor-posix-flag-for-multiuser-mounts.patch b/queue-4.19/smb3-honor-posix-flag-for-multiuser-mounts.patch new file mode 100644 index 00000000000..a61845e4e58 --- /dev/null +++ b/queue-4.19/smb3-honor-posix-flag-for-multiuser-mounts.patch @@ -0,0 +1,51 @@ +From e876d8a2d315ea5e699cadb21d72ec6bb9e2b112 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 26 Jun 2020 12:58:09 -0700 +Subject: SMB3: Honor 'posix' flag for multiuser mounts + +From: Paul Aurich + +[ Upstream commit 5391b8e1b7b7e5cfa2dd4ffdc4b8c6b64dfd1866 ] + +The flag from the primary tcon needs to be copied into the volume info +so that cifs_get_tcon will try to enable extensions on the per-user +tcon. At that point, since posix extensions must have already been +enabled on the superblock, don't try to needlessly adjust the mount +flags. + +Fixes: ce558b0e17f8 ("smb3: Add posix create context for smb3.11 posix mounts") +Fixes: b326614ea215 ("smb3: allow "posix" mount option to enable new SMB311 protocol extensions") +Signed-off-by: Paul Aurich +Signed-off-by: Steve French +Reviewed-by: Aurelien Aptel +Signed-off-by: Sasha Levin +--- + fs/cifs/connect.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c +index 9e569d60c636b..136de62f351a7 100644 +--- a/fs/cifs/connect.c ++++ b/fs/cifs/connect.c +@@ -4602,6 +4602,7 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid) + vol_info->nohandlecache = master_tcon->nohandlecache; + vol_info->local_lease = master_tcon->local_lease; + vol_info->no_linux_ext = !master_tcon->unix_ext; ++ vol_info->linux_ext = master_tcon->posix_extensions; + vol_info->sectype = master_tcon->ses->sectype; + vol_info->sign = master_tcon->ses->sign; + +@@ -4629,10 +4630,6 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid) + goto out; + } + +- /* if new SMB3.11 POSIX extensions are supported do not remap / and \ */ +- if (tcon->posix_extensions) +- cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_POSIX_PATHS; +- + if (cap_unix(ses)) + reset_cifs_unix_caps(0, tcon, NULL, vol_info); + +-- +2.25.1 + diff --git a/queue-4.19/virtio-blk-free-vblk-vqs-in-error-path-of-virtblk_pr.patch b/queue-4.19/virtio-blk-free-vblk-vqs-in-error-path-of-virtblk_pr.patch new file mode 100644 index 00000000000..0fec193d3d7 --- /dev/null +++ b/queue-4.19/virtio-blk-free-vblk-vqs-in-error-path-of-virtblk_pr.patch @@ -0,0 +1,36 @@ +From 701e43ef1063ae36fc798098ae8b78bd2495af61 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 15 Jun 2020 12:14:59 +0800 +Subject: virtio-blk: free vblk-vqs in error path of virtblk_probe() + +From: Hou Tao + +[ Upstream commit e7eea44eefbdd5f0345a0a8b80a3ca1c21030d06 ] + +Else there will be memory leak if alloc_disk() fails. + +Fixes: 6a27b656fc02 ("block: virtio-blk: support multi virt queues per virtio-blk device") +Signed-off-by: Hou Tao +Reviewed-by: Stefano Garzarella +Reviewed-by: Ming Lei +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + drivers/block/virtio_blk.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c +index 9be54e5ef96ae..075523777a4a9 100644 +--- a/drivers/block/virtio_blk.c ++++ b/drivers/block/virtio_blk.c +@@ -882,6 +882,7 @@ static int virtblk_probe(struct virtio_device *vdev) + put_disk(vblk->disk); + out_free_vq: + vdev->config->del_vqs(vdev); ++ kfree(vblk->vqs); + out_free_vblk: + kfree(vblk); + out_free_index: +-- +2.25.1 + -- 2.47.3