Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'rpmsg-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux

Pull rpmsg updates from Bjorn Andersson:
"This contains fixes and cleanups in the rpmsg core, Qualcomm SMD and
GLINK drivers, a circular lock dependency in the Mediatek driver and
a possible race condition in the rpmsg_char driver is resolved"

* tag 'rpmsg-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux:
rpmsg: convert sysfs snprintf to sysfs_emit
rpmsg: qcom_smd: Fix refcount leak in qcom_smd_parse_edge
rpmsg: qcom: correct kerneldoc
rpmsg: qcom: glink: remove unused name
rpmsg: qcom: glink: replace strncpy() with strscpy_pad()
rpmsg: Strcpy is not safe, use strscpy_pad() instead
rpmsg: Fix possible refcount leak in rpmsg_register_device_override()
rpmsg: Fix parameter naming for announce_create/destroy ops
rpmsg: mtk_rpmsg: Fix circular locking dependency
rpmsg: char: Add mutex protection for rpmsg_eptdev_open()

+20 -17
+2
drivers/rpmsg/mtk_rpmsg.c
··· 234 234 if (info->registered) 235 235 continue; 236 236 237 + mutex_unlock(&subdev->channels_lock); 237 238 ret = mtk_rpmsg_register_device(subdev, &info->info); 239 + mutex_lock(&subdev->channels_lock); 238 240 if (ret) { 239 241 dev_err(&pdev->dev, "Can't create rpmsg_device\n"); 240 242 continue;
+5 -4
drivers/rpmsg/qcom_smd.c
··· 729 729 } 730 730 731 731 /** 732 - * qcom_smd_send - write data to smd channel 732 + * __qcom_smd_send - write data to smd channel 733 733 * @channel: channel handle 734 734 * @data: buffer of data to write 735 735 * @len: number of bytes to write 736 - * @wait: flag to indicate if write has ca wait 736 + * @wait: flag to indicate if write can wait 737 737 * 738 738 * This is a blocking write of len bytes into the channel's tx ring buffer and 739 739 * signal the remote end. It will sleep until there is enough space available ··· 1089 1089 1090 1090 /* Assign public information to the rpmsg_device */ 1091 1091 rpdev = &qsdev->rpdev; 1092 - strncpy(rpdev->id.name, channel->name, RPMSG_NAME_SIZE); 1092 + strscpy_pad(rpdev->id.name, channel->name, RPMSG_NAME_SIZE); 1093 1093 rpdev->src = RPMSG_ADDR_ANY; 1094 1094 rpdev->dst = RPMSG_ADDR_ANY; 1095 1095 ··· 1323 1323 1324 1324 spin_unlock_irqrestore(&edge->channels_lock, flags); 1325 1325 1326 - strncpy(chinfo.name, channel->name, sizeof(chinfo.name)); 1326 + strscpy_pad(chinfo.name, channel->name, sizeof(chinfo.name)); 1327 1327 chinfo.src = RPMSG_ADDR_ANY; 1328 1328 chinfo.dst = RPMSG_ADDR_ANY; 1329 1329 rpmsg_unregister_device(&edge->dev, &chinfo); ··· 1383 1383 } 1384 1384 1385 1385 edge->ipc_regmap = syscon_node_to_regmap(syscon_np); 1386 + of_node_put(syscon_np); 1386 1387 if (IS_ERR(edge->ipc_regmap)) { 1387 1388 ret = PTR_ERR(edge->ipc_regmap); 1388 1389 goto put_node;
+6 -1
drivers/rpmsg/rpmsg_char.c
··· 120 120 struct rpmsg_device *rpdev = eptdev->rpdev; 121 121 struct device *dev = &eptdev->dev; 122 122 123 - if (eptdev->ept) 123 + mutex_lock(&eptdev->ept_lock); 124 + if (eptdev->ept) { 125 + mutex_unlock(&eptdev->ept_lock); 124 126 return -EBUSY; 127 + } 125 128 126 129 get_device(dev); 127 130 ··· 140 137 if (!ept) { 141 138 dev_err(dev, "failed to open %s\n", eptdev->chinfo.name); 142 139 put_device(dev); 140 + mutex_unlock(&eptdev->ept_lock); 143 141 return -EINVAL; 144 142 } 145 143 146 144 eptdev->ept = ept; 147 145 filp->private_data = eptdev; 146 + mutex_unlock(&eptdev->ept_lock); 148 147 149 148 return 0; 150 149 }
+2 -1
drivers/rpmsg/rpmsg_core.c
··· 604 604 int ret; 605 605 606 606 if (driver_override) 607 - strcpy(rpdev->id.name, driver_override); 607 + strscpy_pad(rpdev->id.name, driver_override, RPMSG_NAME_SIZE); 608 608 609 609 dev_set_name(dev, "%s.%s.%d.%d", dev_name(dev->parent), 610 610 rpdev->id.name, rpdev->src, rpdev->dst); ··· 618 618 strlen(driver_override)); 619 619 if (ret) { 620 620 dev_err(dev, "device_set_override failed: %d\n", ret); 621 + put_device(dev); 621 622 return ret; 622 623 } 623 624 }
+2 -2
drivers/rpmsg/rpmsg_internal.h
··· 41 41 rpmsg_rx_cb_t cb, void *priv, 42 42 struct rpmsg_channel_info chinfo); 43 43 44 - int (*announce_create)(struct rpmsg_device *ept); 45 - int (*announce_destroy)(struct rpmsg_device *ept); 44 + int (*announce_create)(struct rpmsg_device *rpdev); 45 + int (*announce_destroy)(struct rpmsg_device *rpdev); 46 46 }; 47 47 48 48 /**