Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3281243ybd; Fri, 28 Jun 2019 06:03:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9lH8jbDUlKcJyRlDl6zaMpxzOyYHoxXh9+jlLg74AiypPCUEAINel9WF1yulXvN54wMVr X-Received: by 2002:a17:902:31c3:: with SMTP id x61mr11275252plb.331.1561727024061; Fri, 28 Jun 2019 06:03:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561727024; cv=none; d=google.com; s=arc-20160816; b=PIU4WH9jnVKzEbkZLYNsssOCM00lIBsyV4rk2ibr9JurQ353C2LtFtuFKML05X9ClV 3yOQzzSrTCUH5HVS0YmQfDuvLxVeN6rnK2tnuWk0iiiMymFXy9XsA62WvPQuHTrnq06t 8WB9rSCDYZX45nRM0ALd7EYqA55VB41pFbJZYSr6tXBh6+zG2uH5of51u0s7tmfmV6z/ K12m8pSe9UTiQ2xBtifdHKnhIixzsXBYzBEwf7bDLa2hoeFQNzr/Vl0TulgKgosGVHR3 rLB/IMCrw5k7W52fNiQwgUwIBOe1OE+KLSzD67Avlk3Se+tMBhI4LQM/3XvRYqgQV/qL nxzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=GDdYN5kQt5oodJg9h0fQ+PGqnlQ6057Y5ThAbiMCFHE=; b=kGbvqMoLkkF1bZokJqFpkPGjhMQE1yLpcLXZLV9EavejHQCinZ70lglGPrwZ3n2zES vPHkvoN/D0Aermfyy9IaOxYSem2hNId48XwUzR1L5ZHIEgIVmNUi37UVvPbliQSLMOht vnCtiUYeshFhE/flJCC95EYtjd+AYo5DdJtviwpspuRhxwD2N1O0X1BFnFmUJx1SfNfV yHJk0rMkKxn/vIxMIZmYcjgybOdGFlY5Tlr7iRMNGs24Vz2Z0JUm8T63Y3JfOOAVA7nS 3N95X2vFaeeWgwK7troh+wsEPyU0VoI5p6u8IUyOsITlci26wJeLSuqDsCn35qluB2b/ 4xGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aStCg4Hr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q187si2117919pga.220.2019.06.28.06.03.05; Fri, 28 Jun 2019 06:03:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aStCg4Hr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727206AbfF1NAg (ORCPT + 99 others); Fri, 28 Jun 2019 09:00:36 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:46016 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727180AbfF1NAe (ORCPT ); Fri, 28 Jun 2019 09:00:34 -0400 Received: by mail-wr1-f66.google.com with SMTP id f9so6174709wre.12 for ; Fri, 28 Jun 2019 06:00:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GDdYN5kQt5oodJg9h0fQ+PGqnlQ6057Y5ThAbiMCFHE=; b=aStCg4HrF6BmAN5ZprxLweMHT3TIAHKj9unAhcfV7uHqCXxK/8cTWppGWhbH6ZIp28 X1QPv8tS/qz0Nlfbj4S7cWYVVp7LxyG+w+c6yBHwIHX3raV4D1AfsFzmFUuBghwvbcFv b+W4geq0zgQs+TlGDuYDGhYHSWbOaXWX1d35Ijn1iH7mZcWV8bjjBoQo3AFPPkWcg1eW 24QBV7tmPeX4wF/K953B6FL5UGulav6XLBmO+/XtUGvPCh42HQObW993Q35MrOM2mhxa 7fHSc/28OoOlsMRatKMoqX1LuISEQ6/3YoixCLbhReBc7C4wC8aX16RVtlAOmpCJEZha 30IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GDdYN5kQt5oodJg9h0fQ+PGqnlQ6057Y5ThAbiMCFHE=; b=fnt7VYx0I+waOMOlyI+Fz/3eKKgxBM2ZNgfEWBPwLdzP0kRacme+JIQtFyOGAlTwcg XQ18inWA1yuS8tNaWMh9+3pubtA9QR+IqLcw00iAmmSeBewxXPwcfRgkd+uGyj6CZOgA 5UhH+3g5g2RWTXBbgryDdf6mGoFgBXlNgZmvRWCc41/TcVtd+aJ7tSROsc+QzxVwQxSB lfVf0xesJ9dVy+HBpmG9YWgAU9VXLZ6TSossbrorxgVhsEWJ16GEtRBc1fRaazg7745v QpdF+r0hi3xW3ZH6xq+l0Q5TTeYeBdCZY/3BLBG5jvIzQQurR3MOUWDTm3gYOeLcs1lU yyHg== X-Gm-Message-State: APjAAAUiZc/gMMLSoVmQKeoxTO5CdnyB4cHFnxUMTBFSN8UUk+KCLEa5 TV+GlVILNAEgT7eskbvhr16hsQ== X-Received: by 2002:adf:e2c7:: with SMTP id d7mr7602029wrj.272.1561726832700; Fri, 28 Jun 2019 06:00:32 -0700 (PDT) Received: from localhost.localdomain ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id w20sm3717174wra.96.2019.06.28.06.00.31 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 28 Jun 2019 06:00:32 -0700 (PDT) From: Stanimir Varbanov To: linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab , Hans Verkuil , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vikash Garodia , Tomasz Figa , Alexandre Courbot , Stanimir Varbanov Subject: [PATCH v2 05/11] venus: hfi: return an error if session_init is already called Date: Fri, 28 Jun 2019 15:59:56 +0300 Message-Id: <20190628130002.24293-6-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190628130002.24293-1-stanimir.varbanov@linaro.org> References: <20190628130002.24293-1-stanimir.varbanov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This makes hfi_session_init to return an error when it is already called without a call to hfi_session_deinit. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/hfi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/platform/qcom/venus/hfi.c b/drivers/media/platform/qcom/venus/hfi.c index 82eb889ab541..3d8b1284d1f3 100644 --- a/drivers/media/platform/qcom/venus/hfi.c +++ b/drivers/media/platform/qcom/venus/hfi.c @@ -198,6 +198,9 @@ int hfi_session_init(struct venus_inst *inst, u32 pixfmt) const struct hfi_ops *ops = core->ops; int ret; + if (inst->state != INST_UNINIT) + return -EINVAL; + inst->hfi_codec = to_codec_type(pixfmt); reinit_completion(&inst->done); -- 2.17.1