Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91553bb2 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "coresight: tmc-etr: fix null ptr dereferencing in usb_qdss_close"

parents c3d28bf0 362fd879
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1407,7 +1407,8 @@ static int tmc_enable_etr_sink_sysfs(struct coresight_device *csdev)
	 */
	spin_lock_irqsave(&drvdata->spinlock, flags);
	sysfs_buf = READ_ONCE(drvdata->sysfs_buf);
	if (!sysfs_buf || (sysfs_buf->size != drvdata->size)) {
	if (!sysfs_buf || (sysfs_buf->size != drvdata->size)
			|| !drvdata->usbch) {
		spin_unlock_irqrestore(&drvdata->spinlock, flags);

		if (drvdata->out_mode == TMC_ETR_OUT_MODE_MEM) {
@@ -1952,6 +1953,7 @@ static int _tmc_disable_etr_sink(struct coresight_device *csdev)
			spin_unlock_irqrestore(&drvdata->spinlock, flags);
			tmc_etr_bam_disable(drvdata);
			usb_qdss_close(drvdata->usbch);
			drvdata->usbch = NULL;
			drvdata->mode = CS_MODE_DISABLED;
			goto out;
		} else {