forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/media/tuners/tuner-xc2028.c
....@@ -381,7 +381,7 @@
381381 goto corrupt;
382382 }
383383
384
- priv->firm[n].ptr = kzalloc(size, GFP_KERNEL);
384
+ priv->firm[n].ptr = kmemdup(p, size, GFP_KERNEL);
385385 if (priv->firm[n].ptr == NULL) {
386386 tuner_err("Not enough memory to load firmware file.\n");
387387 rc = -ENOMEM;
....@@ -394,7 +394,6 @@
394394 type, (unsigned long long)id, size);
395395 }
396396
397
- memcpy(priv->firm[n].ptr, p, size);
398397 priv->firm[n].type = type;
399398 priv->firm[n].id = id;
400399 priv->firm[n].size = size;