forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/media/usb/dvb-usb/m920x.c
....@@ -1,12 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /* DVB USB compliant linux driver for MSI Mega Sky 580 DVB-T USB2.0 receiver
23 *
34 * Copyright (C) 2006 Aapo Tahkola (aet@rasterburn.org)
45 *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU General Public License as published by the
7
- * Free Software Foundation, version 2.
8
- *
9
- * see Documentation/media/dvb-drivers/dvb-usb.rst for more information
6
+ * see Documentation/driver-api/media/drivers/dvb-usb.rst for more information
107 */
118
129 #include "m920x.h"
....@@ -280,7 +277,6 @@
280277 char *read = kmalloc(1, GFP_KERNEL);
281278 if (!read) {
282279 ret = -ENOMEM;
283
- kfree(read);
284280 goto unlock;
285281 }
286282
....@@ -291,8 +287,10 @@
291287
292288 if ((ret = m920x_read(d->udev, M9206_I2C, 0x0,
293289 0x20 | stop,
294
- read, 1)) != 0)
290
+ read, 1)) != 0) {
291
+ kfree(read);
295292 goto unlock;
293
+ }
296294 msg[i].buf[j] = read[0];
297295 }
298296
....@@ -472,8 +470,8 @@
472470
473471 /* Callbacks for DVB USB */
474472 static int m920x_identify_state(struct usb_device *udev,
475
- struct dvb_usb_device_properties *props,
476
- struct dvb_usb_device_description **desc,
473
+ const struct dvb_usb_device_properties *props,
474
+ const struct dvb_usb_device_description **desc,
477475 int *cold)
478476 {
479477 struct usb_host_interface *alt;