From patchwork Sat Oct 1 17:10:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 12996630 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAC26C433FE for ; Sat, 1 Oct 2022 17:11:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229488AbiJARLE (ORCPT ); Sat, 1 Oct 2022 13:11:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbiJARLE (ORCPT ); Sat, 1 Oct 2022 13:11:04 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 129D45A2ED for ; Sat, 1 Oct 2022 10:11:03 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id e10-20020a05600c4e4a00b003b4eff4ab2cso6741197wmq.4 for ; Sat, 01 Oct 2022 10:11:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=gTWeyuBeEhL5q970/uX9nPUe0s0gUyxTu1xA+Ah5iEY=; b=g2uBr9Pp7Fg69xveOwl6IoppzylYHg7FU3wX/3x9b9enW8WtrSH8jJG8KUxOIZ1vC3 pj/fRv4vdZv69Gzw5ElJkxGBhmkDMEGX97R27fYIqz0DYuVgBT7NLJjoj1t3kDdM9LQw 5GZe4hk13JZqO44HGPsxhUE30grWO/3HWoZeHfbPwZATTYGWQc8PmL0ciwYHWPosNrEL CEzi7nH3NNFl8ssq+axjQ9f9UDfSjEEjQW+EvCATYo9ydeA0ny4wdXvLwHaexjzFRW+n qN8qM0Ah65Zts8b+0dDlan/kcZpdZO10UdON80GiQV9vWCOtk6pxwVWsYwE+Sy/dFbsv 49xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=gTWeyuBeEhL5q970/uX9nPUe0s0gUyxTu1xA+Ah5iEY=; b=GrlxE7406yL2ZU8otxHSMhy/x0xi30MAU+ZyiqfR1iTv0/C87rlyPt9wGyRjRl5+1+ z4AOY0TUGnWcm366hJu8PZU5/zvyxv2MJwHr4jk9k3E0AhhkoZzjh0ZQzNULsA4uiEJe 1LJ3LR/a7NG1tEWnKL970suBMM2iLyUOU0LWWg7npmc5XyPwUUWBB68SpMxR1JjQt76Q D0zBJWNLprEWsLW0/XTsS2NbpX3zei6i5NCQIIfvQSMp+L5jyhDEv+ModIf0PgG2dsFq 2oQsA4RZCPjV54RZRPWXqUQPdtp4C1oyFbadvXgP3nQIrX4Vz15f0aARkGTh1xp1Zw3j JC3w== X-Gm-Message-State: ACrzQf3L+G7lhqsr1UNt3o7VfqkEl72vlosztPFi8XFT5da3+nTSCinq CK7/NNfyGQZvA6/KNXRkJ/tOCw== X-Google-Smtp-Source: AMsMyM6PVEI2wRzKAZUo9Jw5t15nBqPVD0/JQK7uj8wZtBbsWSr8KGTkcVdVWHn6vc0IlIiARd7R7Q== X-Received: by 2002:a7b:ce97:0:b0:3b3:4136:59fe with SMTP id q23-20020a7bce97000000b003b3413659femr2236430wmj.24.1664644261573; Sat, 01 Oct 2022 10:11:01 -0700 (PDT) Received: from radium.lan ([88.160.162.107]) by smtp.gmail.com with ESMTPSA id h40-20020a05600c49a800b003b49ab8ff53sm5817641wmp.8.2022.10.01.10.10.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Oct 2022 10:11:00 -0700 (PDT) From: Fabien Parent To: ilia.lin@kernel.org, agross@kernel.org, bjorn.andersson@linaro.org, rafael@kernel.org, viresh.kumar@linaro.org Cc: linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent Subject: [PATCH 1/3] cpufreq: qcom: fix memory leak in error path Date: Sat, 1 Oct 2022 19:10:25 +0200 Message-Id: <20221001171027.2101923-1-fabien.parent@linaro.org> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org If for some reason the speedbin length is incorrect, then there is a memory leak in the error path because we never free the speedbin buffer. This commit fixes the error path to always free the speedbin buffer. Signed-off-by: Fabien Parent --- drivers/cpufreq/qcom-cpufreq-nvmem.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c index 863548f59c3e..3bd38acde4b9 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c @@ -213,6 +213,7 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev, int speed = 0, pvs = 0, pvs_ver = 0; u8 *speedbin; size_t len; + int ret = 0; speedbin = nvmem_cell_read(speedbin_nvmem, &len); @@ -230,7 +231,8 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev, break; default: dev_err(cpu_dev, "Unable to read nvmem data. Defaulting to 0!\n"); - return -ENODEV; + ret = -ENODEV; + goto len_error; } snprintf(*pvs_name, sizeof("speedXX-pvsXX-vXX"), "speed%d-pvs%d-v%d", @@ -238,8 +240,9 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev, drv->versions = (1 << speed); +len_error: kfree(speedbin); - return 0; + return ret; } static const struct qcom_cpufreq_match_data match_data_kryo = { From patchwork Sat Oct 1 17:10:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 12996631 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65E6DC43217 for ; Sat, 1 Oct 2022 17:11:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229436AbiJARLG (ORCPT ); Sat, 1 Oct 2022 13:11:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbiJARLG (ORCPT ); Sat, 1 Oct 2022 13:11:06 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B6045A2ED for ; Sat, 1 Oct 2022 10:11:04 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id u10so11071307wrq.2 for ; Sat, 01 Oct 2022 10:11:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=YHOQ8ywlbK0fpRlF8bymKRRxYbAe1JYFFKpNvoXmLTc=; b=PQYX1b3WPfpe0x2Fmbp2rME42Xu5jQKv6PUU6e/28nzTG072cA+2b+CrAKYB/kSUYc MelmLmb/pQco1l5kSxx7OLn1QcyeDQQmBuY24NXePgq25OO9j/iAD0K05hU/ctnJSrJ9 vPEUOEEMNU5poui0za/ihUstAYbUNYGDxabqAWKhVKKUUslr0GuYwyPv7eKxg3QZnfI9 gamj1GfvuXEsePfHhx6K8ns5zTdtaoTvovBHPXPsh2YOrDYtqkMcMkv54kCYYiL1TJi9 wAqWtXCdjum9wQu9qv9cxRsFDEzWh4yICOxQGMNnZI+deWlQ/eRfckwtNyvyK76brV+W O6UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=YHOQ8ywlbK0fpRlF8bymKRRxYbAe1JYFFKpNvoXmLTc=; b=m5uq3UYxyl0A4VQyd5oJISZMff+Wg0eKmnOjtFVs2sGPOybuc8N5CwwLcO4bM/03qu onKwH2uUolK4+DBlae6yEK/Xdq59EMXsIbKXQlcQ0aSM6mqvIJUr7xl5q8KeuWR50OeF eTLQs6YA2D82K91GMMz4NslAJC7UQAW5rZAQ1NFrrM6My/IS4MOALplnvZRZQaN08hk/ wNCnQOq57N0Z0XdB6L/nuKH0tj7g/FRbsGdgR8p6k2OElWqXDmpJG8lgcmkdx2ulUpkw 8spPnBEBmdXg9V4VJwIzZaU0BKy1txAeWD8GZVGIb6b5BkqzMvKhn9ie9ak+tJfwAMCv 4Lsw== X-Gm-Message-State: ACrzQf06ycTexbTA5elsUHi1x1vgQgjSLDoc89lWR9jByRA2f3iicBJr NwSOFBqifyScMnp7tGOFSRBP2w== X-Google-Smtp-Source: AMsMyM4Rgu7zhGQsIpV1EOpQQ3WcvL47Dq2sP16tSAWhcfuj52TzHaGFdXlgR6FATnwHIGLb636zAQ== X-Received: by 2002:a05:6000:2a7:b0:22a:f98f:b75f with SMTP id l7-20020a05600002a700b0022af98fb75fmr9443666wry.373.1664644262969; Sat, 01 Oct 2022 10:11:02 -0700 (PDT) Received: from radium.lan ([88.160.162.107]) by smtp.gmail.com with ESMTPSA id h40-20020a05600c49a800b003b49ab8ff53sm5817641wmp.8.2022.10.01.10.11.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Oct 2022 10:11:02 -0700 (PDT) From: Fabien Parent To: ilia.lin@kernel.org, agross@kernel.org, bjorn.andersson@linaro.org, rafael@kernel.org, viresh.kumar@linaro.org Cc: linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent Subject: [PATCH 2/3] cpufreq: qcom: pass pvs_name size along with its buffer Date: Sat, 1 Oct 2022 19:10:26 +0200 Message-Id: <20221001171027.2101923-2-fabien.parent@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221001171027.2101923-1-fabien.parent@linaro.org> References: <20221001171027.2101923-1-fabien.parent@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The get_version handler takes a pvs_name buffer and can override it with the speed, pvs, and pvs version values. The function does not take as argument the buffer size and is currently being determined by calling `sizeof("speedXX-pvsXX-vXX")`. This is not great because it duplicates the string in several locations which makes it error-prone if we need to modify the string someday. Also since the buffer and its size are tied together, it makes sense that they should both be passed together to the get_version as parameters. This commit makes sure that the PVS name template string is only defined once, and that the pvs_name buffer is passed with its size. Signed-off-by: Fabien Parent --- drivers/cpufreq/qcom-cpufreq-nvmem.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c index 3bd38acde4b9..64ce077a4848 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c @@ -30,6 +30,7 @@ #include #define MSM_ID_SMEM 137 +#define PVS_NAME_TEMPLATE "speedXX-pvsXX-vXX" enum _msm_id { MSM8996V3 = 0xF6ul, @@ -50,6 +51,7 @@ struct qcom_cpufreq_match_data { int (*get_version)(struct device *cpu_dev, struct nvmem_cell *speedbin_nvmem, char **pvs_name, + size_t pvs_name_size, struct qcom_cpufreq_drv *drv); const char **genpd_names; }; @@ -172,6 +174,7 @@ static enum _msm8996_version qcom_cpufreq_get_msm_id(void) static int qcom_cpufreq_kryo_name_version(struct device *cpu_dev, struct nvmem_cell *speedbin_nvmem, char **pvs_name, + size_t pvs_name_size, struct qcom_cpufreq_drv *drv) { size_t len; @@ -208,6 +211,7 @@ static int qcom_cpufreq_kryo_name_version(struct device *cpu_dev, static int qcom_cpufreq_krait_name_version(struct device *cpu_dev, struct nvmem_cell *speedbin_nvmem, char **pvs_name, + size_t pvs_name_size, struct qcom_cpufreq_drv *drv) { int speed = 0, pvs = 0, pvs_ver = 0; @@ -235,7 +239,7 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev, goto len_error; } - snprintf(*pvs_name, sizeof("speedXX-pvsXX-vXX"), "speed%d-pvs%d-v%d", + snprintf(*pvs_name, pvs_name_size, "speed%d-pvs%d-v%d", speed, pvs, pvs_ver); drv->versions = (1 << speed); @@ -265,7 +269,7 @@ static int qcom_cpufreq_probe(struct platform_device *pdev) struct nvmem_cell *speedbin_nvmem; struct device_node *np; struct device *cpu_dev; - char *pvs_name = "speedXX-pvsXX-vXX"; + char *pvs_name = PVS_NAME_TEMPLATE; unsigned cpu; const struct of_device_id *match; int ret; @@ -306,8 +310,8 @@ static int qcom_cpufreq_probe(struct platform_device *pdev) goto free_drv; } - ret = drv->data->get_version(cpu_dev, - speedbin_nvmem, &pvs_name, drv); + ret = drv->data->get_version(cpu_dev, speedbin_nvmem, &pvs_name, + sizeof(PVS_NAME_TEMPLATE), drv); if (ret) { nvmem_cell_put(speedbin_nvmem); goto free_drv; From patchwork Sat Oct 1 17:10:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 12996632 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0804C433F5 for ; Sat, 1 Oct 2022 17:11:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229577AbiJARLM (ORCPT ); Sat, 1 Oct 2022 13:11:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbiJARLI (ORCPT ); Sat, 1 Oct 2022 13:11:08 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 888905A3F6 for ; Sat, 1 Oct 2022 10:11:06 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id d12-20020a05600c3acc00b003b4c12e47f3so3695258wms.4 for ; Sat, 01 Oct 2022 10:11:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=KyEHZH41+VDH9bxxt3p+dgtz1T9wbtc1HGrXs5RGSsY=; b=DoDARNqoL7+Q63BrbqhTfjnWZYx3qIWl8quEhAIddkb33lWwgDOGMHzs83j78geKio hEJahX3TB2WJwUxSD5zjFc3JmSRKhKb3v0j29HDahGu6HEreLmWvg53+X4uElH0AvU3f Q8wIOMB9XTGyeB8kZ6zfvpgNsXZnfl8yFfglHExHttiduFxgf68vZAJzhbgrjG6r/+D8 PNsTUc09JCPJTMahqYyzShcWYOpyo+2QLDGg2TMuIzcMuIXHcB0x05h/4X/7IfjE7dTn MsbgDe1TR79H+/MZ21Qs1SJqomC5RfwaiS3j+wjinPqUYOCiUZ6UThWIRMol2bAZROcn dMZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=KyEHZH41+VDH9bxxt3p+dgtz1T9wbtc1HGrXs5RGSsY=; b=1rV6/wAOiBhrjMrIMPJYXNNhsZzROb/Sn2On/yOsqG7lQsZORjNv+2jBhDezVQRLQB sytrthyCYtnS4KB1iROsBfzAgOY5/FnHR8YIiM/m0a4PSUW8mMz0C/l63SW7A8AAT0OP f9aiEr/3bZfutenYoszeQR0IIQzYT2t2TlnuAJHlwM1q/PztV7RzKjntjAJWeIwDZkbR 1O0h5latn+QkD/cy6oYEvE2HGQJZd6qwbcIFrLVGvOarJnbmV9/+u3+amyNFV+ESJmyO PA9ebpfg+ejWF9XATQZRNdC9JHuALUBz4wYncOiMuRUgk5SekMnC7t8oSlKqZxLQDiah /LBg== X-Gm-Message-State: ACrzQf3GhnEgMaCokUFECaCJuPyD+iMfFTcbVJ5otz0kAgJKC3ncgwEY 6Qenux7mIQBZNrLibMIZn3m9uA== X-Google-Smtp-Source: AMsMyM5tt70mEqXeE2WtfEki09ee7rn3yDJD/EYzSGYsbMj0yZQymyg/P+IRhjzNe57uaeBW7ovJ5g== X-Received: by 2002:a05:600c:3511:b0:3b4:bb85:f1e3 with SMTP id h17-20020a05600c351100b003b4bb85f1e3mr2254005wmq.0.1664644264502; Sat, 01 Oct 2022 10:11:04 -0700 (PDT) Received: from radium.lan ([88.160.162.107]) by smtp.gmail.com with ESMTPSA id h40-20020a05600c49a800b003b49ab8ff53sm5817641wmp.8.2022.10.01.10.11.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Oct 2022 10:11:04 -0700 (PDT) From: Fabien Parent To: ilia.lin@kernel.org, agross@kernel.org, bjorn.andersson@linaro.org, rafael@kernel.org, viresh.kumar@linaro.org Cc: linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent Subject: [PATCH 3/3] cpufreq: qcom: fix writes in read-only memory region Date: Sat, 1 Oct 2022 19:10:27 +0200 Message-Id: <20221001171027.2101923-3-fabien.parent@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221001171027.2101923-1-fabien.parent@linaro.org> References: <20221001171027.2101923-1-fabien.parent@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This commit fixes a kernel oops because of a write in some read-only memory: [ 9.068287] Unable to handle kernel write to read-only memory at virtual address ffff800009240ad8 ..snip.. [ 9.138790] Internal error: Oops: 9600004f [#1] PREEMPT SMP ..snip.. [ 9.269161] Call trace: [ 9.276271] __memcpy+0x5c/0x230 [ 9.278531] snprintf+0x58/0x80 [ 9.282002] qcom_cpufreq_msm8939_name_version+0xb4/0x190 [ 9.284869] qcom_cpufreq_probe+0xc8/0x39c ..snip.. The following line defines a pointer that point to a char buffer stored in read-only memory: char *pvs_name = PVS_NAME; This pointer is meant to hold a template "speedXX-pvsXX-vXX" where the XX values get overridden by the qcom_cpufreq_krait_name_version function. Since the template is actually stored in read-only memory, when the function executes the following call we get an oops: snprintf(*pvs_name, sizeof(PVS_NAME), "speed%d-pvs%d-v%d", speed, pvs, pvs_ver); To fix this issue, we instead store the template name onto the stack by using the following syntax: char pvs_name_buffer[] = PVS_NAME; Because the `pvs_name` needs to be able to be assigned to NULL, the template buffer is stored in the pvs_name_template and not under the pvs_name variable. Signed-off-by: Fabien Parent --- drivers/cpufreq/qcom-cpufreq-nvmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c index 64ce077a4848..3e097262f612 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c @@ -269,7 +269,8 @@ static int qcom_cpufreq_probe(struct platform_device *pdev) struct nvmem_cell *speedbin_nvmem; struct device_node *np; struct device *cpu_dev; - char *pvs_name = PVS_NAME_TEMPLATE; + char pvs_name_buffer[] = PVS_NAME_TEMPLATE; + char *pvs_name = pvs_name_buffer; unsigned cpu; const struct of_device_id *match; int ret;