From fe8e66032af250e587757638bc8f1364ef8b13a3 Mon Sep 17 00:00:00 2001 From: Michael Black Date: Sun, 12 Jan 2020 22:55:32 -0600 Subject: [PATCH] Fix cppcheck warning in kpa.c --- amplifiers/elecraft/kpa.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/amplifiers/elecraft/kpa.c b/amplifiers/elecraft/kpa.c index 372873109..42a2cb03d 100644 --- a/amplifiers/elecraft/kpa.c +++ b/amplifiers/elecraft/kpa.c @@ -59,8 +59,6 @@ const struct fault_list kpa_fault_list [] = int kpa_init(AMP *amp) { - struct kpa_priv_data *priv; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); if (!amp) @@ -68,16 +66,14 @@ int kpa_init(AMP *amp) return -RIG_EINVAL; } - priv = (struct kpa_priv_data *) + amp->state.priv = (struct kpa_priv_data *) malloc(sizeof(struct kpa_priv_data)); - if (!priv) + if (!amp->state.priv) { return -RIG_ENOMEM; } - amp->state.priv = (void *)priv; - amp->state.ampport.type.rig = RIG_PORT_SERIAL; return RIG_OK;