Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89822f8e authored by Lihua Liu's avatar Lihua Liu Committed by nshrivas
Browse files

qcacmn: Add sanity check for htc_callbacks

Add NULL check for htc_callbacks.dsrHandler to avoid NULL dereference
in hif_irq_handler().

Change-Id: I21752f6fe9ef2b337e20523eb0569c6884dee506
CRs-Fixed: 2283763
parent 6a3c5f76
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -1398,7 +1398,7 @@ void hif_sdio_shutdown(struct hif_softc *hif_ctx)
 */
static void hif_irq_handler(struct sdio_func *func)
{
	QDF_STATUS status;
	QDF_STATUS status = QDF_STATUS_SUCCESS;
	struct hif_sdio_dev *device;

	AR_DEBUG_PRINTF(ATH_DEBUG_TRACE,
@@ -1410,6 +1410,7 @@ static void hif_irq_handler(struct sdio_func *func)
	 * it when we process cmds
	 */
	sdio_release_host(device->func);
	if (device->htc_callbacks.dsrHandler)
		status = device->htc_callbacks.dsrHandler(device->htc_callbacks
						  .context);
	sdio_claim_host(device->func);