From nobody Sat Nov 30 04:36:36 2024 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6DF5339BC for ; Thu, 12 Sep 2024 08:51:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726131104; cv=none; b=YoT1lRGVevskzqp+Lb/rfAFDDEmM5lW852DpkoXrWFjf/PYwVKCS9AUkzPhNPNuM28JcbIOIR0QDcqGhR9vFo2xcsvrTrnWw7J1KP1I+2xZfb0mNkHIg4NL5qkJ5NowUEcj9/fQNEVFuZs6hcnu89K6pWSD6MPcYpEFzFGG+6To= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726131104; c=relaxed/simple; bh=ZW9q90WrD+G0PAKw9e8G1vmoJHNTZdJBVRRsoqphIxg=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=ej/o3zHa7tZJ2qlq33JhYfdoNxD4+aGQvweFEFNkcn7KLtShXMKXM5XThzTm1LabDuId++XO+kGZmd0bTF1en8f7f2RXcxVIMYpkX6ZKLayOtTwdzkfBBL3r38aA0TviVXIqbUw+7eXHWdJMfoBmIRYv0AwBpyfY4NSHETnKsSE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Sgq2vzHJ; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Sgq2vzHJ" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-42cd46f3a26so5269905e9.2 for ; Thu, 12 Sep 2024 01:51:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726131101; x=1726735901; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=81XtS8l9mSMS4c/2nDpcx8nr5/0qweJ+8RlF2VnBxMA=; b=Sgq2vzHJYTzK/jIvF0o/jECGn4rrANu9qf8tpT3BA7R2fiIESfKEa/XzjSwgiWwqAR SvBEqot6obIjZ4ViCWs/PR7qci7vmtrx7wMOp7TbeESAzW1hku38lJ9wAXsZd5Sw9uMF yODQ4KWaR3rzh/wMW2kv5qu7rZ9tH4fqGviyMkbwC/Fx7v4smwZBavNHmcoXBT9WnEt0 /UdlaaCp52KigrdWpR22PRi8IkpGOO05v4JUYx4IPxu59VwhuMM4VN2Bpgu0zbXG9d3K +LCIt65C2QHTqdn+o9QfB8k6iUoRrti3BZifQ7bPk1ofPqyPC82o0aQNpB6yw0+0mcet fPxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726131101; x=1726735901; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=81XtS8l9mSMS4c/2nDpcx8nr5/0qweJ+8RlF2VnBxMA=; b=G3rTRFan2D3PF64ToOsJ0vixtIUjzph0zFJE18PV3H6gxpamud/g5z35UKmzBJbZef GCO+K32ckfTq6612cIGmKq5Pt4gDvMM8FURqTHGGuZ5lwWVsEHGCndD4tfDbtbViJlBk z2pz07Lt2HC4QBn4HQygOfTXzGNZAhn6mZOWjopJ/labtk8AYe1sL9YpZRrTRG4x4aw1 Gso8kWJJBh24mSr2AdDgsvE3ww/E30VCHualxL4nlyJa9VLBfYPJ4bvS2kwqq1kUutJG 0JD06TWpMcVgKwWb0SydaJ1yGwONLqcYF2e/18/acziJhoErV7HeMkpokZt3bq4aF/uv TkYw== X-Forwarded-Encrypted: i=1; AJvYcCUjDyMF0+3M0sJTX7+jjQ1xwOzZGAPQpoFcoaBrtQQxR3ILGpw+kS3U/m4sfQuPKrG2wxb5859Nk2ubius=@vger.kernel.org X-Gm-Message-State: AOJu0YwXQ6N1a+FAcCFBb8CvwM86IddfoYgF8WyFGTaJ52iAEFmscv7v VOulvzj94UddW+lBJ/E7xrtCTnRl4QKfgtFcbTaTrNv3oyXlD6CVpFUn6OfWTzA= X-Google-Smtp-Source: AGHT+IGMgDiKAbBW7n/kM+sVyZkco74cXOo2c6V3865Igi3TJeLceEdfuNeJlBvdLqEo3zo9Zo5mkQ== X-Received: by 2002:a05:600c:3ba4:b0:426:6e86:f82 with SMTP id 5b1f17b1804b1-42cdb57ecbemr15170135e9.22.1726131101129; Thu, 12 Sep 2024 01:51:41 -0700 (PDT) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675c56sm14168144f8f.57.2024.09.12.01.51.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2024 01:51:40 -0700 (PDT) Date: Thu, 12 Sep 2024 11:51:31 +0300 From: Dan Carpenter To: Julien Massot Cc: Mauro Carvalho Chehab , Hans Verkuil , Sakari Ailus , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] media: i2c: max96717: clean up on error in max96717_subdev_init() Message-ID: <23251b8e-c148-44ef-bc9b-f39cecc4fb12@stanley.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Call v4l2_ctrl_handler_free() to clean up from v4l2_ctrl_handler_init(). Fixes: 50f222455793 ("media: i2c: add MAX96717 driver") Signed-off-by: Dan Carpenter Reviewed-by: Julien Massot --- From static analysis. Not tested. drivers/media/i2c/max96717.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/max96717.c b/drivers/media/i2c/max96717.c index 4e85b8eb1e77..9259d58ba734 100644 --- a/drivers/media/i2c/max96717.c +++ b/drivers/media/i2c/max96717.c @@ -697,8 +697,10 @@ static int max96717_subdev_init(struct max96717_priv *= priv) priv->pads[MAX96717_PAD_SOURCE].flags =3D MEDIA_PAD_FL_SOURCE; =20 ret =3D media_entity_pads_init(&priv->sd.entity, 2, priv->pads); - if (ret) - return dev_err_probe(dev, ret, "Failed to init pads\n"); + if (ret) { + dev_err_probe(dev, ret, "Failed to init pads\n"); + goto err_free_ctrl; + } =20 ret =3D v4l2_subdev_init_finalize(&priv->sd); if (ret) { --=20 2.45.2