]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/rtc/nvmem.c
nvme-tcp: fix possible leakage during error flow
[linux.git] / drivers / rtc / nvmem.c
index dce518d5e50edd2961cb53ec08ac55a67cbc2ab8..4312096c773873160c583d2efd9d5b99ac646508 100644 (file)
@@ -1,11 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * RTC subsystem, nvmem interface
  *
  * Copyright (C) 2017 Alexandre Belloni
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
  */
 
 #include <linux/err.h>
@@ -46,7 +43,7 @@ static int rtc_nvram_register(struct rtc_device *rtc,
 {
        int err;
 
-       rtc->nvram = kzalloc(sizeof(struct bin_attribute), GFP_KERNEL);
+       rtc->nvram = kzalloc(sizeof(*rtc->nvram), GFP_KERNEL);
        if (!rtc->nvram)
                return -ENOMEM;