local_buf = kzalloc(sizeof(char)*(count), GFP_KERNEL);
- memcpy(local_buf, buf, strlen(buf));
+ memcpy(local_buf, buf, count);
c = ":";
s = local_buf;
pr_err("please config keyname item\n");
goto err;
}
- strcpy(efusekey_infos[index].keyname, uname);
+ strncpy(efusekey_infos[index].keyname, uname,
+ strlen(uname) > sizeof(efusekey_infos[index].keyname) ?
+ sizeof(efusekey_infos[index].keyname):strlen(uname));
ret = of_property_read_u32(np_key, "offset",
&(efusekey_infos[index].offset));
if (ret) {
void __iomem *payload = ctlr->payload_base;
int idx = chan->index;
struct mhu_data_buf *data;
- unsigned int *pp;
u32 status = readl(mbox_base + RX_STATUS(idx));
if (status && irq == chan->rx_irq) {
data = chan->data;
- pp = (unsigned int *)data->rx_buf;
if (!data)
return IRQ_NONE; /* spurious */
if (data->rx_buf)
int32_t amlkey_init_gen(uint8_t *seed, uint32_t len, int encrypt_type)
{
int32_t ret = 0;
- uint32_t actual_size;
+ uint32_t actual_size = 0;
#ifndef OTHER_METHOD_CALL
ret = store_operation_init();
int32_t amlkey_init_m8b(uint8_t *seed, uint32_t len, int encrypt_type)
{
int32_t ret = 0;
- uint32_t actual_size;
+ uint32_t actual_size = 0;
#ifndef OTHER_METHOD_CALL
ret = store_operation_init();
/* show all the keys*/
for (index = 0; index < key_cnt; index++) {
unifykey = unifykey_find_item_by_id(&(ukdev->uk_header), index);
- n += sprintf(&buf[n], "%02d: %s, %s, %x\n",
- index, unifykey->name,
- keydev[unifykey->dev], unifykey->permit);
+ if (unifykey != NULL)
+ n += sprintf(&buf[n], "%02d: %s, %s, %x\n",
+ index, unifykey->name,
+ keydev[unifykey->dev], unifykey->permit);
}
buf[n] = 0;
return n;
}
_out:
- if (!IS_ERR_OR_NULL(keydata))
- kfree(keydata);
+ kfree(keydata);
+ keydata = NULL;
return count;
}
#ifndef __LINUX_MEMORY_HOTPLUG_H
#define __LINUX_MEMORY_HOTPLUG_H
+#ifndef CONFIG_AMLOGIC_MODIFY
#include <linux/mmzone.h>
+#endif
#include <linux/spinlock.h>
#include <linux/notifier.h>
#include <linux/bug.h>
#include <linux/types.h>
#include <linux/percpu.h>
+#ifndef CONFIG_AMLOGIC_MODIFY
#include <linux/mm.h>
+#endif
#include <linux/mmzone.h>
#include <linux/vm_event_item.h>
#include <linux/atomic.h>